github中合并行为的差异

时间:2017-10-01 05:36:25

标签: git github

我在github中有一个PR,在UI中,它显示它可以合并而不会发生冲突:

enter image description here

但是当我尝试在本地从命令行将master合并到PR时,git报告合并冲突:

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.

如果有人能够解释这种行为差异,我将非常感激。

2 个答案:

答案 0 :(得分:0)

您应该尝试在本地合并PR分支以查看这些冲突:

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

(而不是合并主人)

你应该为你解决冲突(或者提到公关的作者,让他/她解决和更新他/她的公关)

答案 1 :(得分:0)

我不能从问题中的信息中说出任何明确的信息,但我可以说有什么可以帮助你进行调查。您可以获取PR的merge参考:

git fetch https://github.com/your/repo refs/pull/12345/merge:refs/remotes/origil-pr/12345-merge

(替换您的存储库和PR的相关详细信息)

然后你可以验证合并父母是否与你想象的相同,并看看有什么冲突的解决方案。