Created
April 15, 2014 12:52
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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