Git Cheatsheet 1. git checkout -b Create a new branch with the name 2. git branch List all branches in the repository 3. git branch -d Delete a branch after it has been merged 4. git branch -D Delete a branch regardless of its state 5. git diff Get the differences between two branches 6. Process for editing and committing changes back to Subversion git checkout -b ...hack...hack...hack... git commit -a git checkout master git svn fetch git svn rebase git merge git svn dcommit -e (this may need to be precessed by a number of "git stash" commands until it behaves). 7. Getting changes to relative to master (files only). Omit --name-only to get actual diff git diff --name-only master...events-listing 8. User "git mergetool" to fix any problems with rebasing 9. Cherry picking commits to remove from a branch git rebase -i HEAD~120 10. Removing a file from the repository without deleting it git rm --cached 11. Reset the master branch back to svn git reset --hard master 12. Deleting a remote branch (remote branch name is "newfeature") git push origin :newfeature 13. Tricking git into thinking a file has not been changed (but don't put it into the gitignore list) git update-index --assume-unchanged This is reversed by this: git update-index --no-assume-unchanged 14. Creating a new branch from a remote branch git checkout origin/ -b 15. Undelete a branch before other things git checkout -b new_branch_name HEAD@{1}