使用 git,如何执行“使用他们的”类型的分支合并命令?该命令应该用原始版本覆盖我的本地版本。
要将您的 master 替换为 origin master:
$ git checkout master
$ git branch -M master old-master
$ git checkout --track -b master origin/master
The git-merge
联机帮助页将“我们的”策略定义为(添加了强调)
合并策略
ours
This resolves any number of heads, but the result of the merge
is always the current branch head. It is meant to be used to
supersede old development history of side branches.
如果您希望远程分支获胜,请创建一个跟踪分支,检查它,然后git merge -s ours ...
从那里。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)