git config --global user.name= git config --global user.email= git config --global core.editor=vim
git init Initialize directory for git repo git add Add files to staging git add . Adds all files to staging git commit -m "message" Commit staged changes git commit --amend Amend last commit
git mv Move/rename a file git rm Removes file from disk future commits git rm --cached -r Removes from commit staging git checkout -- Reverts to last commit (preferred) git reset --hard Resets to last or specific commit
git show Shows diff for commit
git remote add Add a remote repo git remote add origin git remote remove Removes remote repo git remote rename Renames remote repo
git push Pushes repo to remote git push --all Pushes all local branches to server
git branch Shows which branches are available git branch Create new branch (does not change to it) git checkout Switches to branch git checkout -b Create local branch and track remote branch git branch -r Shows any remote branches that you don't have locally git branch -d Offers to merge etc git branch -D Forceful delete
git merge Merges on to current branch
git fetch Fetch remote branch git fetch git pull Fetch remote branch and merge with current local