Hey, I’m Parker.

Creator of music, photography, and (mostly open) software.

Git Cheat-Sheet

I was recently cleaning out my room at home (I'm back from college for the summer) and found an old git cheat-sheet. I thought I would electronically log it for future reference (as though I don't use git every day or something...).

git init
git clone git://github.com/username/repo.git
git add filename
git status [-s]
git diff [--cached] [HEAD] [--stat]
git commit [-a] [-m "commit message"]
git reset [HEAD]
git rm [--cached] filename
# (by adding --cached, the file that's deleted
# will be left in your local directory)
git branch branchname
git checkout branchname
git checkout -b branchname
git branch -d branchname # (delete)
git merge branchname # (merges 'branchname' to current branch)
git mv file newfile
git log [--oneline] [--graph] [branchname] [^compared_branch_name]
git tag -a msg commit_shortcode
git remote [-v]
git remote add alias [email protected]:username/repo.git
git fetch alias