Git#

Discard unstaged changes#

Discard unstaged changes [1]:

git checkout -- .

Committing#

Override configured user for single commit [2]:

git -c "user.name=Your Name" -c "user.email=Your email" commit

Branching#

Merge changes in SOURCE into DEST:

git co <DEST>
git merge <SOURCE>

Rebase changes in SOURCE on to DEST:

git co <SOURCE>
git rebase <DEST>

Displaying#

Show previous file revision [3]:

git show <REVISION>:<PATH>

Show all tracked files [4]:

git ls-tree -r master