Create a new branch from your git stash

Some­times when you have a tonne of changes you real­ize that you prob­a­bly want to keep all of them in a new branch instead of as a new com­mit in the cur­rent branch. Nor­mally you would sim­ply do a git stash and then cre­ate a new branch and then do a git stash pop. You can reduce this to a sin­gle step by the command

git stash branch <new branch name>

Thats it, you instantly have all the changes in your work­ing dir + stage, all checked out into a new branch


Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *