简体   繁体   English

github:如何记录合并冲突

[英]github: how to record merge conflicts

I have one branch local_branch and I merged into it from a new remote.我有一个分支local_branch ,我从一个新的远程合并到它。 Now there is a plenty of merge conflicts that I need to resolve.现在有很多我需要解决的合并冲突。 After solving them I need the resolution of the conflicts to propagate somehow to local master branch (by issuing pull request) instead of resolving them over between master and local_branch .解决它们之后,我需要解决冲突以某种方式传播到本地master分支(通过发出拉取请求),而不是在masterlocal_branch之间解决它们。

Whats best way to achieve that?实现这一目标的最佳方法是什么?

I don't want to directly merge the new remote into master because I want to issue a git pull request for the old remote for my colleagues to see which and how conflicts were resolved.我不想直接将新遥控器合并到master中,因为我想为旧遥控器发出git pull request ,以便我的同事查看哪些冲突以及如何解决。

Just to clarify:只是为了澄清:

  1. new_remote branch -> local_branch (from old remote) new_remote branch -> local_branch (来自旧远程)
  2. Resolve merge conflicts解决合并冲突
  3. Pull request to merge to master (how to avoid second resolution of the very same conflicts?).将请求合并到master (如何避免相同冲突的第二次解决?)。 master is pretty close to the local_branch , so between them there are no issues (before new remote merge) master非常接近local_branch ,因此它们之间没有问题(在新的远程合并之前)

Merge master into local_branch , resolve the conflicts, then push.master合并到local_branch ,解决冲突,然后推送。 This should be your normal process: update your branch, then push.这应该是您的正常流程:更新您的分支,然后推送。

If master and new_remote_branch are similar you should not have to resolve the same conflicts twice;如果masternew_remote_branch相似,则不必两次解决相同的冲突; Git merging compares only the tips of each branch, not the histories. Git 合并只比较每个分支的提示,而不是历史记录。 You may have different conflicts.你可能有不同的冲突。

Try it.试试看。 If it goes really wrong you can always abort the merge: git merge --abort如果真的出错了,您可以随时中止合并: git merge --abort

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM