opike opike - 3 years ago 169
Git Question

difference in merge behavior in github

I have a PR in github where in the UI, it shows that it can be merged without conflicts:

enter image description here

But when I attempt to merge master into the PR from the command line locally, git reports merge conflicts:

Olivers-MacBook-Pro:incrementum oliverpike$ git merge master
Auto-merging src/components/StudyPanel/index.js
Auto-merging src/components/StudyPanel/StudyPanel.less
CONFLICT (content): Merge conflict in src/components/StudyPanel/StudyPanel.less
Removing spec/indexSpec.js
Auto-merging server/routes/response.js
Auto-merging server/routes/index.js
CONFLICT (content): Merge conflict in server/routes/index.js
Auto-merging server/routes/dispute/validator.js
CONFLICT (add/add): Merge conflict in server/routes/dispute/validator.js
Auto-merging package.json
Auto-merging npm-shrinkwrap.json
CONFLICT (content): Merge conflict in npm-shrinkwrap.json
Auto-merging migrations/20170909131130-responses.js
CONFLICT (add/add): Merge conflict in migrations/20170909131130-responses.js
Recorded preimage for 'migrations/20170909131130-responses.js'
Recorded preimage for 'npm-shrinkwrap.json'
Recorded preimage for 'server/routes/dispute/validator.js'
Recorded preimage for 'server/routes/index.js'
Recorded preimage for 'src/components/StudyPanel/StudyPanel.less'
Automatic merge failed; fix conflicts and then commit the result.

If someone can explain this difference in behavior, I'd be very grateful.

Answer Source

You should try and merge the PR branch locally to see what those conflicts are:

git fetch
git checkout -b  pull/ID/head BRANCHNAME
git checkout master
git merge BRANCHNAME

(instead of merging master)

You should get conflicts for you to resolve (or to mention to the author of that PR, for him/her to resolve and update his/her PR)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download