简体   繁体   English

如何解决 VSCode GitHub 拉取请求和问题扩展中的分支冲突?

[英]How to resolve branch conflicts in VSCode GitHub Pull Requests and Issues extension?

I can't figure out how to resolve the conflict in this pull request so that I can merge it.我不知道如何解决这个拉取请求中的冲突,以便我可以合并它。 How can I fix the problem using the VSCode GitHub Pull Requests and Issues GUI?如何使用 VSCode GitHub Pull Requests and Issues GUI 解决问题?

There are only three lines that have changed, all within one file, for this pull request.对于这个拉取请求,只有三行发生了变化,都在一个文件中。 The pull request description and diff are shown in the first two images below, respectively.拉取请求描述和差异分别显示在下面的前两个图像中。 Nothing there seems to be in conflict.似乎没有任何冲突。 However, when I look at the code for the master branch that I am trying to merge into, shown in the third image, line 17 is different.但是,当我查看要合并到的 master 分支的代码时,如第三张图片所示,第 17 行是不同的。 I think that is the conflict.我认为这就是冲突。 Why doesn't that conflict show up in the diff?为什么这种冲突没有出现在差异中? How can I keep line 17 from the master branch, add line 17 from the pull request below it, merge back to the master branch, and close the pull request?如何从主分支保留第 17 行,从其下方的拉取请求中添加第 17 行,合并回主分支,然后关闭拉取请求? I haven't found a way to view the pull request code side by side with the master code and I'm not sure which I need to push updates to.我还没有找到将拉取请求代码与主代码并排查看的方法,我不确定我需要将更新推送到哪个。

拉取请求描述

拉取请求差异

主分支

I am trying to merge the pink branch in the graphic below.我正在尝试合并下图中的粉红色分支。

在此处输入图片说明

You should be in the branch you are currently modifying (not master ) and first merge master into this branch: under source control, click the three dots and select in the menu Branch -> Merge Branch (see screenshot) and select Master .您应该在您当前正在修改的分支(不是master )中并首先将master合并到该分支中:在源代码管理下,单击三个点并在菜单中选择Branch -> Merge Branch (参见屏幕截图)并选择Master It will say you now have conflicts that you need to resolve manually, and then you should be clear to go.它会说你现在有需要手动解决的冲突,然后你应该清楚了。

截屏

First of all, you must click "Exit Review Mode" to become back the regular code!首先,您必须点击“退出审核模式”才能恢复正常代码! After them, you must approve the changes (with or without a comment) and then, you must go to GitHub and click there "Merge pull request" (with or without a comment) and the Pull Request would merge back to the branch, where you started/created the Pull Request.在他们之后,您必须批准更改(有或没有评论),然后,您必须转到 GitHub 并单击那里的“合并拉取请求”(有或没有评论),拉取请求将合并回分支,其中您启动/创建了拉取请求。

Github Pull Requests Extension for Visual Studio Code 用于 Visual Studio 代码的 Github 拉取请求扩展

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

相关问题 GitHub:git pull冲突,您如何解决“合并”? - GitHub: git pull conflicts, how do you resolve a “merge”? Git 解决开发时的冲突开发和发布分支只能通过拉取请求修改 - Git resolve conflicts develop and release branch when develop can only be modified through pull requests 如何解决github上的合并冲突 - How to resolve merging conflicts on github 当`git pull上游branch_name`不应该发生冲突时,如何处理GitHub的情况? - How to handle the GitHub situation when `git pull upstream branch_name` gives conflicts when it shouldn't? 如何拉出不同的远程分支并合并冲突 - How to pull a different remote branch and merge conflicts 如何比较 github 存储库中所有打开的拉取请求是否相互冲突? - How do I compare all open Pull Requests in a github repo for conflicts with each other? 在执行拉取请求时解决 Github 上的冲突的最简单方法是什么 - What is the easiest way to resolve conflicts on Github when doing a Pull Request Github 从开发分支到主分支的拉取请求显示以前的提交。如何避免此类问题? - Github Pull Request from Develop branch to Master branch shows previous commits .How can I avoid such issues? 在GitHub上工作,对请求请求和避免冲突感到困惑 - Working on GitHub, confused about pull requests and avoiding conflicts 如何解决xcode ui中的git pull冲突 - How to resolve git pull conflicts in xcode ui
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM