Resolving merge conflicts on GitHub

Merge conflict

Merge conflict happens when two branches modify the same file and the same line of code. Git will not merge the branches automatically but displays the error message. We need to resolve all merge conflicts in order to merge a pull request successfully.

 

Automation Re-base

Resolve conflict

Simple merge conflicts can be resolved by using the Resolve conflicts button in the pull request.

Resolve Merge Conflicts

 

Click on the Resolve conflicts button.

Manually resolve the merge conflict. Decide which code to retain and remove the unnecessary code changes.

 

Merge conflicts Demo

 

Mark the conflict as Resolved by clicking the Mark as resolved button.

Click on the Commit merge button.

Now the Merge pull request button would be enabled.

Merge pull request after merge

 

Click on the Merge pull request to merge the changes and resolved conflicts.