Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

will creating a git branch delete my local changes [duplicate]

Tags:

git

Possible Duplicate:
Git - Create a branch with current changes

I have done a whole lot of work on my project which I realise should have been done on another branch. If I create a branch now, will my current changes need to be checked in, or will they be wiped when the new branch is created? I'm rather new to GIT and am just trying to avoid making a newbie mistake.

like image 336
Nippysaurus Avatar asked Jan 29 '11 10:01

Nippysaurus


1 Answers

If you create a new branch from the current HEAD using:

$ git checkout -b newbranchname

Then changes will NOT be overwritten.

like image 142
bdonlan Avatar answered Oct 13 '22 02:10

bdonlan