merge conflicts

Christian Avila October 26, 2021

I am wondering what are the best practices for resolving merge conflicts. in my particular case I want to basically overwrite the destination branch with the files of my development branch. However, I am not able to do so because of merge conflict. basically there was another commit on the destination branch and that file is different that the baseline used in my development branch. I understand the reason why the merge conflict is highlighted but in this particular case I just want to overwrite that file with the one from my development branch without having to do any local changes. is there any way to achieve this?

2 comments

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2021

Best practices for merge conflicts is to update your local copy of the destination branch, merge it with your development branch, and then push your development branch back to Bitbucket. By doing this you can decide to overwrite everything on the destination branch with your changes.

Like Christian Avila likes this
Christian Avila October 28, 2021

thanks this is very helpful!

Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 27, 2021

Some teams may have a policy in place where pushing code to important branches like `develop`, `release` or `master` are not permitted.

In this case you 

 

git checkout feature/branch

git fetch origin develop

git merge FETCH_HEAD

 

And follow @Mikael Sandberg advice above. Most IDEs support resolving merge conflicts through their GUI where you can choose which code segment to accept.

Once you have resolved conflicts (and perhaps quickly built your code) run

 

git commit

 

which will conclude the merge.

Then push your feature branch to bitbucket (remote) and create a formal pull request from feature/branch to develop  for your team to approve and merge, so all changes are consolidated in your target (develop) branch.

Let me know how you go, happy to help.

Best, Ulrich

Izymes

Like # people like this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events