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
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.
git merge branch-name
), Git will indicate conflicted files. You can also check with git status
.<<<<<<< HEAD
, =======
, and >>>>>>> branch-name
to highlight conflicting sections.git add filename
.git commit -m "Resolved merge conflicts"
.Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.