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

后端 未结 10 1521
灰色年华
灰色年华 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:28

    Here is a much simpler way:

    1. Create a new branch

    2. On your new branch do a git merge master- this will merge your committed (not pushed) changes to your new branch

    3. Delete you local master branch git branch -D master Use -D instead of -d because you want to force delete the branch.

    4. Just do a git fetch on your master branch and do a git pull on your master branch to ensure you have your teams latest code.

提交回复
热议问题