recent posts

How to resolve bitbucket merge conflicts to master from a release branch?

This happens a fair amount on bitbucket, and I needed a reminder on how to resolve the conflicts without merging the branch into my feature branch which would cause history issues.

Steps

  1. $ git checkout master
  2. $ git checkout -b resolve-conflicts-branch
    • You want to branch off of master to see the conflicted changes
  3. $ git pull origin release/branch-id
    • This should move the changes you wanted to go into master into the newly created branch
  4. All the merge conflicts should appear, now sort them out
  5. git push -u origin resolve-conflicts-branch
    • Push to remote so you can create a PR
  6. Create a pull request from source resolve-conflicts-branch to release/branch-id
  7. Review and use merge commit -no-ff strategy.
This is useful if you are trying to make a pull request to master, but there are merge conflicts that need to be resolved. In your pull request, you might not see any diff's, but the history change and conflict resolution is there. Merge it into the release branch, and that should resolve your merge conflicts in the pull request that is going into master.

Notes

If you apply this method for a merge conflict resolution using develop, you will want to open a PR from resolve-conflicts-branch to develop instead of the release/branch-id since develop will have activity that master wont.  


How to resolve bitbucket merge conflicts to master from a release branch? How to resolve bitbucket merge conflicts to master from a release branch? Reviewed by JJ The Engineer on 2:40 PM Rating: 5

No comments:

Powered by Blogger.