Skip to content

Instantly share code, notes, and snippets.

@tahirm
Created April 15, 2014 12:52
Show Gist options
  • Save tahirm/10730039 to your computer and use it in GitHub Desktop.
Save tahirm/10730039 to your computer and use it in GitHub Desktop.
Move uncommitted work to a new branch in git. #git #branch From http://stackoverflow.com/questions/1394797/move-existing-uncommited-work-to-a-new-branch-in-git
$ git checkout -b <new-branch>
This will leave your current branch as is, create and checkout a new branch and keep all your changes. You can then make a commit with:
$ git add <files>
and commit to your new branch with:
$ git commit
The changes in the working directory and changes staged in index do not belong to any branch yet. This changes where those changes would end in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment