Azure DevOps - Pull Request Git “Next steps: Manually resolve these conflicts and push new changes to the source branch.”

前端 未结 3 1222
旧时难觅i
旧时难觅i 2021-01-30 13:12

I have created a branch named dev.

I have done a pull request to send dev code to master, when I do this pull request it tell me:

50+ conflicts prevent automati

3条回答
  •  醉话见心
    2021-01-30 13:38

    Since you need to keep the files version on dev branch (keep the source branch while changing files in target branch master), so you should make changes on master branch to resolve the conflict files, and be sure you have permission to push changes to master branch.

    You can use below options:

    Option 1: merge directly

    In your local repo, you can execute below commands to merge dev into master branch while keeping the conflict files version as the dev branch:

    git checkout master
    git merge dev -X theirs
    git push origin master
    

    And in the existing pull request you created, it will shows the branch has been merged. So you can abandon the pull request.

    Option 2: still merge via pull request (resolve conflicts on master branch)

    You can use below commands to resolve conflicts in master branch:

    # In yout local repo
    git checkout master
    git checkout dev -- .
    git commit -m 'replace master branch version by dev for the conflict files'
    git push origin master 
    

    While the changes in existing pull request won’t be updated if new commit(s) pushs to the target branch (master). And you can find the similar report Pull request diff does not update when a commit from the PR is merged to the target via another branch.

    That means, the pull request in the web page still show the conflicts. You should abandon the existing pull request and reactivate (or create a new one) to merge dev into master branch.

提交回复
热议问题