git basics

Below are some very basic git commands. Please see our department docs on using Swarthmore GitHub Enterprise for help using Swat GitHub for CS classes.

basic git commands

To turn the current directory into a local git repo:

git init           # initialize repo
git add .          # add all files to repo
git commit -a      # initial commit

To show the status of a repo:

git status         

To see a log of all past commits:

git log

Basic workflow:

edit or add a file to the repo
git status
git add edited_file
git commit -m "add commit message here"
git status

Other resources:


Back to SwatCS Help Docs