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

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

    1. Checkout fresh copy of you sources

      git clone ........

    2. Make branch from desired position

      git checkout {position} git checkout -b {branch-name}

    3. Add remote repository

      git remote add shared ../{original sources location}.git

    4. Get remote sources

      git fetch shared

    5. Checkout desired branch

      git checkout {branch-name}

    6. Merge sources

      git merge shared/{original branch from shared repository}

提交回复
热议问题