Scenario: You have a merge conflict

Unfortunately github can’t handle this in browser.

It is up to the lord of the repository (you) to handle this.

Say you have a pull request from the branch problemBranch with a merge conflict to master:

conflict message

Steps to handle:

1) Go to the command line and enter your repo’s directory:

  cd path/to/project/
  

2) Make sure everything is up to date with the github hosted repo:

  git pull
  

3) Make a branch to handle the merge conflict:

  git checkout -b HR_Department origin/problemBranch
  

4) Merge with the master to see problems:

  git merge master
  

Git ever so kindly automatically modifies the files with conflicts in them to point out where they overlap. (If you want to see a list of the files that have this problem simply run the command git diff --name-only --diff-filter=U.)

Now head to the file (or files) in question to see the conflict.

conflict

Starting at the <<<<<<< we have the line as it is in the new branch and after the ======= we have the line as it is in the branch we are attempting to merge into, the whole conflict is ended by >>>>>>>.

At this point you must decide which line to keep (, or include both of them) and edit the text manually.

conflict

5) Now merge the conflict free branch to master. You can do this in either the github interface (see previous) or the command line:

git checkout master
git merge --no-ff HR_Department
git push origin master

6) Revel in the seamlessly modified code.