Home Navigation

Tuesday 17 April 2018

How to resolve a conflict when you try to create a pull request to review your code to master

You have two options to resolve the conflict:
1) Resolve them without a pull request.
To do this, you would checkout the master branch, and then pull in the release branch. This is effectively the solution that Bitbucket Server give you when you ask for more information on how to solve the conflict.
git checkout master
git pull origin featureBranch1
resolve merge conflicts
git push

2) Resolve them with a pull request
To do this, you would create a branch off the tip of master, pull in the release branch and create a pull request from that branch to master. This is the best option if you don't have permission to push directly to master.
git checkout master
git checkout -b resolve-conflicts-branch
git pull origin featureBranch1
resolve merge conflicts
git push -u origin resolve-conflicts-branch
create pull request

No comments:

Post a Comment