git command for making one branch like another

前端 未结 9 1305
半阙折子戏
半阙折子戏 2020-11-22 11:36

I\'m trying to take a branch with changes and bring it back to be identical to the upstream it diverged from. The changes are both local and have been pushed to github, so n

9条回答
  •  爱一瞬间的悲伤
    2020-11-22 11:45

    You can do this rather easily now:

    $ git fetch origin
    $ git merge origin/master -s recursive -Xtheirs
    

    This gets your local repo in-sync with the origin, and preserves the history.

提交回复
热议问题