Skip to content

Instantly share code, notes, and snippets.

@forest
Created April 25, 2009 07:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save forest/101552 to your computer and use it in GitHub Desktop.
Save forest/101552 to your computer and use it in GitHub Desktop.
Git Cheat. #git #cheat
# create a branch
git branch <branch>
# delete a branch
git branch -d|D <branch>
# go back to master
git checkout master
# merge branch to master
git merge --squash <branch>
git merge --squash -s resolve <branch>
# clean up messed up merge, etc.
git checkout .
git clean -d
# init and update submodules
git submodule init
git submodule update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment