git init <repoName>
git clone <url> <name>
git fetch origin <branch>
git pull
git pull origin <branch>
git branch <branch>
git checkout -b <branch> //create a new branch and check it out
git diff to see what has changedgit diff //shows changed files that havent been staged
git diff --staged //shows changed files that have been staged
git addgit add --all //stage all changes including modifications, deletions
git add . // (git 1.x)stage all new files + modifications
git add --ignore-removal . // (git 2.x)stage all new files + modifications
git add -update //stage modifications + deletions
git rm to remove filesgit rm <file> //removes file and stages the removal
git rm --cached <file> //removes file from staging area without removing from disk
git mvgit mv <source> <target> //move (or rename) a file and have the modification tracked (equivalent to git rm + git add)
git commitgit commit -m "commit message here" //commit staged files with message
git commit -a -m "commit message here" //automatically stage files and commit with message
git commit --amend //revise the most recent commit message that hasnt yet been pushed
git pushgit push origin HEAD //push to current branch
git checkout to revert changes on a filegit checkout <commit> -- <file> //pull file into working dir from amother commit
git checkout <commit>^ -- <file> //pull file into working dir from the previous commit (^) to the specified commit
git checkout <commit> path/to/file //revert single file to previous commit