Reputation: 3739
I accidentally forgot to branch before making changes to code. I have not committed anything.
If I branch, will the code follow me to the new branch?
Upvotes: 1
Views: 57
Reputation: 3541
If you want to be 100% clean, I'd say the proper way is to go for
git stash
git branch new_branch
git stash pop
(Although I prefer git push master:new_branch
to create a new branch, and then track it with git checkout -t origin/new_branch
)
Upvotes: 1
Reputation: 127
Yes, if you have not committed your changes yet. You can create a new branch and all changes made will be passed to that branch.
Upvotes: 4