CSCI 3342 Web Development
Spring 2025

HTML and CSS

git and GitHub

...taking your first step into a larger world.
Accept the GitHub Classroom repo invite to create a new (empty) repo for your assignment pages. Practice using the git command-line interface (CLI) to manage your project and submit it.

You'll need an account on GitHub, the dominant cloud-based source control solution

Some useful resources and explanations in the GitHub quickstart docs

Installation Guide for the git Command-Line Interface (CLI)
After you install git, open a terminal and test it with:
$ git --version
git version 2.51.0.windows.1
Then run the following configuration commands. First, set your identity for local commits:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
Second, configure the editor to use for commit messages. You can use whatever editor you want. If in doubt, use whatever you use for your code editor, such as VSCode. On mac/linux you could use "nano" or "vim" if you know and prefer those for quick edits. Make sure that your editor can be launched from the command line by typing its name such as:
$ code
$ nano
$ vim
On mac, vscode has to be configured for this: https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line
Once you confirm that your editor can launch, run this command to set it as the commit editor (the --wait flag is only for vscode):
$ git config --global core.editor "code --wait"
Repo invite for this assignment: https://classroom.github.com/a/6HROiRQx
After you accept the assignment, copy the URL and clone it with:
$ git clone <repo URL>

It should open a browser window for login, but if it asks for username/password at the command line, you need create a Personal Access Token

After you successfully clone, change directories into the repo (e.g. cd 202610-assn01-html-and-css-testguy) and then run this command to configure the commit template. You will need to do each time you clone.

$ git config commit.template .gitmessage

Every time you finish working on your assignment, commit and push. In the root of the repo:

$ git status   // check the state of the repo (and make sure you're in the repo)
$ git add .    // stage all the changes you made
$ git status   // confirm all your changes are there
$ git commit   // commit locally, opens the editor so you can uncomment checklist items and/or add a commit message
$ git push     // send the commit to the server

As a new git user, if anything goes wrong stop and re-clone to a different directory. Move your work over and continue. This is by far the easiest way to get out of any trouble you get into for now.

CLI Quick Reference

  • git clone <repo URL> to create a local copy
  • git status to see what has changed (do this before and after all the other commands!)
  • git add . to stage all changes you've made
  • git commit to store your staged changes as a changeset
  • git push to upload all your changesets to GitHub

Assignment Checklist

Accept the repo invite
(If needed) Generate a Personal Access Token
clone the repo and create the example.html file in the working directory
commit and push your work
Confirm on the github website that your changes were uploaded