Git conflicts in pull requests

前端 未结 1 1261
孤独总比滥情好
孤独总比滥情好 2021-02-05 12:34

I have 2 branches - master and develop

I have been doing some pull requests in my develop branch where it contains 5 items, in whi

1条回答
  •  悲&欢浪女
    2021-02-05 13:30

    What this means is that GitHub would like to merge your PR branch into master, but it can't, because there are conflicts. As you've discussed in the question comments, the best way to deal with this (usually) is to merge your master branch into develop on the command line. That will show you the conflicts and ask you to resolve them. Once you've completed and pushed that merge, the PR will be mergeable back into master using the green button on GitHub.

    You could simply merge your deploy branch into master (which I realize sounds a bit more sensible). In that case, you'd be bypassing the PR entirely. You'd have to close the PR "unmerged", and separately you'd manually push the merge commit to master.

    By doing it the first way,

    1. you make a better audit trail by merging to master on GitHub, using the PR;
    2. you give your team a chance to review your code after the merge, before it lands on master; and
    3. if you have automatic tests (such as Travis CI or CircleCI) which check PRs, you give them a chance to run your merged code as well.

    0 讨论(0)
提交回复
热议问题