是否可以解决 GitHub 的网络界面中的合并冲突

Is it possible to resolve merge conflicts in GitHub's web interface

是否可以解决和合并 GitHub 网络界面中的 git 冲突?

恐怕 Github 网站没有提供处理合并冲突的接口。您需要使用 git 将分支拉到本地计算机并从那里解决冲突。

当您在命令行上正常解决冲突时,您在 Mac 上使用 bash shell 或类似 Git Bash Windows。在您的网络浏览器中,您有一个 JavaScript 命令行,它无法模拟您的 bash shell。

差不多,在线JS无法解决冲突shell.

更新:上个月(2016 年 12 月)发布了 GitHub 中解决简单合并冲突的功能。

如果由于拉取请求的两个不同分支之间同一文件的同一行存在差异而发生合并冲突,您现在可以点击解决冲突拉取请求正文中的按钮以编辑文本。所有其他类型的合并冲突必须在命令行本地解决。

GitHub 文档:https://help.github.com/articles/resolving-a-merge-conflict-on-github/

截至 2016 年 12 月,simple merge conflicts can be resolved in GitHub's web interface

  1. Under your repository name, click Pull requests.

  1. In the "Pull Requests" list, click the pull request with a merge conflict that you'd like to resolve.
  2. Near the bottom of your pull request, click Resolve conflicts.

    • (Tip: If the Resolve conflicts button is deactivated, your pull request's merge conflict is too complex to resolve on GitHub and you must resolve the merge conflict on the command line.)

  1. Decide if you want to keep only your branch's changes, keep only the other branch's changes, or make a brand new change, which may incorporate changes from both branches. Delete the conflict markers <<<<<<<, =======, >>>>>>> and make the changes you want in the final merge.

  1. If you have more than one merge conflict in your file, scroll down to the next set of conflict markers and repeat steps four and five to resolve your merge conflict.
  2. Once you've resolved all the conflicts in the file, click Mark as resolved.

  1. If you have more than one file with a conflict, select the next file you want to edit on the left side of the page under "conflicting files" and repeat steps four through seven until you've resolved all of your pull request's merge conflicts.

  1. Once you've resolved all your merge conflicts, click Commit changes.

  1. To merge your pull request, click Merge pull request. For more information about other pull request merge options, see "Merging a pull request."