I have 100s of changes that I don't want to push to master. Usually I start a new branch, and then merge later.
How can I create a new branch without losing my current changes?
CodePudding user response:
Just do
git stash -m "my awesome changes"
After creating a new branch, just apply
git stash apply --index 0
If you have other stashes, then make sure you use the right index.
CodePudding user response:
Using visual studio
- Commit your changes
- Create new branch (as shown in your image, but uncheck checkout branch)
- Right click the commit before -> reset -> hard reset -> ok (Now you are at the commit before, and your changes are in safe backup branch)
- Checkout your new backup branch -> push (this will create a new branch at
origin
side).