Take all my changes on the current branch and move them to a new branch in Git
If you haven't been committing anything yet, you're already in the right position.
- Create a new branch:
git checkout -b edge
- Your files haven't changed. Just
git add
what needs to and commit as usual. - When you're done committing on
edge
, switch back tomaster
withgit checkout
andgit merge edge
.
To add to JB's answer, if you have already started to make a few commits on master for what ended up as being a "edge" effort, you could:
git stash
git checkout -b edge master
git branch -f master SHA1_before_your_commits
git stash apply