Possible duplicate:Git - create a branch with current changes
I did a lot of work on my project, which, as I understand it, should have been done in another branch. If I now create a branch, will the current changes be checked or will they be erased when a new branch is created? I am new to GIT and just trying to avoid the beginners mistake.
If you create a new branch from the current HEAD using:
$ git checkout -b newbranchname
Then the changes will NOT be overwritten.
In your case, the bdonlan response is used, since creating a new branch does not concern the working directory.
, , Git , , . , .
, , Git stash:
git stash save
, :
git checkout -b new-branch-name
Git stash:
git stash pop
They will be moved to a new branch. But if you feel unsafe, you can always take a backup of your local project directory.