Git local stashes minimal browser

Stash mechanism (sometimes it's called "shelve" – in bazaar for example) is responsible for holding your local changes aside from remote branch. You can save your current work state, switch to different version and restore it later.

In order to quickly inspect list of local stashes content in your working copy you can use the following command:

git stash list | awk -F: '{ print "\n\n\n\n"; print $0; print "\n\n"; system("git –no-pager stash show -p " $1); }' | less

If  you see a change should be deleted it's pretty easy:

git stash drop "stash@{2}"

To load any change onto working copy:

git stash pop "stash@{2}"

Pretty simple, but powerful tool.

This entry was posted in en and tagged . Bookmark the permalink.