Git Tricks

Updated . Posted . Visible to the public.

##Stashing

diff of a stash

git stash show -p stash@{<number of stash>}

diff of most recent stash

git stash show -p

give your stashes names

git stash save "first try"

… then your stash list will be much more informative:

stash@{0}: On my-awesome-branch: first try

create a stash wile also keeping changes

Here you go. Show archive.org snapshot . This also works if you want to stash / keep only certain files.

##Checking out previous branches
Your last checkout is buried in your terminal history? Sure you could reverse-i-search it or up-arrow like a madman but here's a nice shortcut that will go straight to your previously checked out branch:

git checkout -

##Print diff to screen instead of using less

git --no-pager diff

Ignore user-specific files

This is how it works Show archive.org snapshot

Philipp Antar
Last edit
Posted by Philipp Antar to Distribusion IT (2013-10-14 10:02)