Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Is it possible to resolve and merge a git conflict in GitHub's web interface?

like image 410
enthuguy Avatar asked Apr 07 '16 12:04

enthuguy


2 Answers

Update: the ability to resolve simple merge conflicts in GitHub was released last month (Dec 2016).

If a merge conflict has occurred because there’s a difference on the same line of the same file between the two different branches of your pull request, you can now hit the Resolve conflicts button in the body of the pull request to edit the text. All other types of merge conflicts must be resolved locally on the command line.

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

like image 131
CJ Johnson Avatar answered Oct 26 '22 23:10

CJ Johnson


As of December 2016, simple merge conflicts can be resolved in GitHub's web interface.

  1. Under your repository name, click Pull requests.

Pull Requests tab

  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.)

Resolve conflicts button

  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.

Resolving conflicts

  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.

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.

Select a file

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

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."
like image 35
Stevoisiak Avatar answered Oct 27 '22 00:10

Stevoisiak