Having to stash to switch branches?
Do you ever find yourself doing this?
$ git checkout some_branch
error: Your local changes to the following files would be overwritten by checkout:
Gemfile
Please, commit your changes or stash them before you can switch branches.
Aborting
$ git stash
$ git checkout some_branch
$ git stash pop
Here’s a nice little shortcut:
$ git checkout --merge some_branch
Written by Amiel Martin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#