CalebBX
CalebBX

Reputation: 11

Merge conflicts not showing up

So I am trying to merge my development branch into my master branch. The master branch my team has been working on has not been touched for a long time till now with the exception of a accidental merge and then revert a while ago.

Now when I try to merge the branches new code in my dev branch gets overwritten with old code. No conflict is generated its just replaced. Some files are entirely deleted.

Heres what my project looks like the y-d merge was a mistake and was reverted in e f has been committed by a teammate since then. when I try to merge 6 and g i run into problems. But if I reset the HEAD to c and merge it works flawlessly.

MASTER a-b-c-------------d-e-f--g
            \           /      /
dev          1-2-3-----/--4-5-6
                  \   /  /
hotfix             x-y---

I either need to know why my code is getting overwritten without a conflict. Or a way to make my dev code overwrite my master code.

Any help would be greatly appreciated. If more information is needed let me know. I've been googling and trying solutions for the past 8 hours.

Upvotes: 1

Views: 238

Answers (1)

max630
max630

Reputation: 9238

It is case of revert a revert. If you would like to test is first you could do this:

MASTER a-b-c---------------d-e-f----------g (merge --no-ff)
revert_e    \             /     \--e'    /
             \           /          \   /
dev           1-2-3-----/--4-5-6-----7-8
                   \   /  /
hotfix              x-y---

Create a temporary branch revert_e where you revert the e, re-applying d, and merge it into dev, together with hotfixes (gitflow recommends to merge hotfixes from master as they are done). Then you can do testing and maybe fix something. Use git merge --no-ff when you merge the new release, to prevent just forwarding master to 8

Upvotes: 1

Related Questions