Skip to content

Instantly share code, notes, and snippets.

@emmaguy
Last active December 16, 2015 23:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emmaguy/5517492 to your computer and use it in GitHub Desktop.
Save emmaguy/5517492 to your computer and use it in GitHub Desktop.
Useful git commands
git rm --cached `git ls-files -i --exclude-from=.gitignore` >> When updating a .gitignore, remove stuff that's previously added
git diff HEAD^ HEAD >> diff last commit with the version before it
git push origin :abc >> delete remote branch abc
git branch -d abc >> delete local branch abc
git push <origin> <branch name> -- push up new branch
git submodule update --init --recursive
git stash show -p stash@{0} -- diff against stash
git tag -a v1.4 -m 'my version 1.4'
git push origin v1.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment