What is the easiest way to resolve conflicts on Github when doing a Pull Request

1.1k views Asked by At

I am trying to merge branches on GitHub via Pull Request, but I am getting conflicts.

What is the easiest way to solve the conflicts?

1

There are 1 answers

0
The Onin On BEST ANSWER
  1. Use GitHub web editor.

enter image description here

  1. You'll be presented with an editor, which will look like this:

enter image description here

Keep the changes that you want, and delete the rest (including the delimiters).

Assuming you want to keep the code from foo branch, this is how your code should look like after editing:

enter image description here

Using Prev and Next links, navigate to the next conflict:

enter image description here

Hit "Mark as Resolved", and optionally, repeat for other files:

enter image description here

Finally, when you're done resolving all files, a new button appears:

enter image description here

GitHub just introduced this new feature, and it simplifies resolving simple conflicts.

Docs are here: https://help.github.com/articles/resolving-a-merge-conflict-on-github/