Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Frequent Merge Conflicts Between Development and Master Branches

Maxime Aiguier
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 28, 2025

Hello,

I apologize if this is a duplicate post, but I couldn't find an answer on the forum.

I'm not new to Bitbucket, but there's something I don't understand.

I work with another developer, and we follow this branching strategy:

  • Master branch (protected): Our production branch.

  • Development branch (protected): Our staging branch.

To modify these branches, we create feature branches and merge them into development via pull requests.
Master is only updated by merging development into it (which makes sense, as we want to test our changes on staging before deploying them to production).

The issue is that almost every time we merge development into master, we encounter merge conflicts. This is something we want to avoid, as master should be an exact copy of development at the time of merging.

Do you have any idea why this is happening?

Thank you very much for your time and help!

Maxime

1 answer

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
March 28, 2025

Welcome to the community, @Maxime Aiguier 

Without looking closely at your repository, it's difficult to say exactly why. This is fundamentally a git question, and those can be difficult to track down if one isn't an expert. Hopefully, the "what" will show you "why" merge conflicts keep happening.

Broadly speaking, these are the steps to resolve conflicts. Search online for "resolving merge conflicts," and you'll find more details than you need.

 

  • After attempting a merge (e.g., git merge branch-name), Git will indicate conflicted files. You can also check with git status.
  • Open the conflicted file in a text editor. Git inserts markers like <<<<<<< HEAD=======, and >>>>>>> branch-name to highlight conflicting sections.
  • Manually edit the file, choosing which changes to keep or combining them. Remove the conflict markers after resolving. Consider using a visual merge tool or IDE integrations for a more user-friendly experience.
  • After resolving all conflicts in a file, stage it using git add filename.
  • Once all conflicts are resolved and staged, commit the changes with git commit -m "Resolved merge conflicts".

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events