Last Updated: February 25, 2016
·
500
· julianchurchill

Git Stash - Got something else to do, no worries!

Say you're working on your git repository, happily chugging away at a new feature. You've made some progress but nothing worth committing yet, then your boss comes to you and says 'I need a bug fix for this fanangled doo-hickey post-haste!'. Being a git pro you quickly fire off a 'git stash' storing away your working changes without commiting, fire off a new branch, fix the bug, commit and return to your last branch. With a quick wave of your git magic wand you incant the words 'git stash apply' to return to your working changes before you went on bug-fix emergency leave.

git stash is the single most awesome feature of git I've found so far. Of course git is full of awesome features but this is my current number one. I use it all the time, to go try out a quick spike on another branch or merge in some changes I didn't realise I needed until a bit of coding.

http://git-scm.com/book/en/Git-Tools-Stashing