This isn't intended as an exhaustive reference for git. Rather, it's a collection of operations that I perform so rarely that I always have to look up how to do them.
(because I have a weak-ass Internet connection at home)
git fetch --no-tags <remote> <remote-branch-name>:<local-branch-name>
git reset --hard HEAD
Be careful you didn't have any uncommitted changes changes before you started the merge.
git reset --merge
Works on non-ancient versions (>1.6.1) of git.
Undo a commit, leave the files in the commit staged, and don't monkey with other files in the working copy (e.g., not HARD
reset)
git reset --soft HEAD~
git show REV:PATH/TO/FILE
An example - Git Interactive Rebase, Squash, Amend and Other Ways of Rewriting History
Show me what's in master
that isn't in production
yet.
git log production..master
Show me how this file differs between master
and production
.
git diff master production -- file
file
can also be a directory. The --
is optional in some cases.
Make it double-extra impossible to push to the upstream
repo
git remote set-url --push upstream no-push