-2

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?

The Onin
  • 5,068
  • 2
  • 38
  • 55
  • Voting as too broad. – Naman Jan 06 '17 at 19:42
  • @nullpointer GitHub just introduced this feature today, and I think this Q&A could be a good resource for the times to come. – The Onin Jan 06 '17 at 19:44
  • Some repos prefer rebasing the branch so there are no conflicts when merging a pull request. – choroba Jan 06 '17 at 19:46
  • IMO - The question is based on the individual practices and is biased more onto advertising a feature than highlighting the usefulness of it. – Naman Jan 06 '17 at 19:48
  • 1
    @nullpointer, although I agree this is based on individual practices I highly doubt it's just to advertise GH. They're generally very good and open when it comes to stuff like this, and IME in the F/OSS community they like to let their work speak for itself. – Pockets Jan 06 '17 at 20:30

1 Answers1

2
  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/

The Onin
  • 5,068
  • 2
  • 38
  • 55