Putting uncommitted changes at Master to a new branch by Git

Léo Léopold Hertz 준영 picture Léo Léopold Hertz 준영 · Aug 29, 2009 · Viewed 45.7k times · Source

How can you put uncommitted changes to a branch TEST when I am at the branch master?

Answer

Mike Bethany picture Mike Bethany · Dec 17, 2010

Also you can create a new branch and switch to it by doing:

git checkout -b new_branch
git add .

I use this all the time because I always forget to start a new branch before I start editing code.