moving committed (but not pushed) changes to a new branch after pull

后端 未结 10 1559
灰色年华
灰色年华 2020-12-22 15:51

I\'ve done a fair bit of work (\"Your branch is ahead of \'origin/master\' by 37 commits.\") which really should have gone into its own branch rather than into master<

10条回答
  •  难免孤独
    2020-12-22 16:02

    For me this was the best way:

    1. Check for changes and merge conflicts git fetch
    2. Create a new branch git branch my-changes and push to remote
    3. Change upstream to new created branch git master -u upstream-branch remotes/origin/my-changes
    4. Push your commits to the new upstream branch.
    5. Switch back to previous upstream git branch master --set-upstream-to remotes/origin/master

提交回复
热议问题