Problems with git merge

Asked

Viewed 398 times

2

Guys, I’m having a problem I’ve never caught before with git..

In our flow we have a branch called DEV which is where everyone else comes out. And all tasks after finishing go through a merge from DEV to branch and then a pull request is created for DEV (in order to avoid conflict, I don’t know if it is the right one, but the flow is this one) and later after the code review is merged.

What happened was that a branch left DEV and some normal comits were created:

DEV ------------o---o--o---o---------------
BRANCH    \----o----o----o---

After a few changes the developer merged DEV into branch and created a commit.

DEV ------------o---o--o---o---------------
BRANCH    \----o----o----o---\--0 (merge commit)--o-/

I went to analyze the merge commit and there was no file, it was just a merge commit without any changes and that’s when the problem starts happening.

Between the period that the branch was gaining changes dev also gained and when it was merged from dev to branch it should have gained all these changes, but that doesn’t happen and I don’t know why.

If I merge using git merge dev within the branch yet some of the changes don’t see, even though you haven’t touched the specific files that should come.

But if I create a last commit branch before the merge and merge the changes comes. Only after the merge does it all get bizarre.

Does anyone have any tips?

  • 1

    Paulo, when weird situations like this happen with Git, you need to know which commands were used. Do you know how the user merged? It seems that the branch merge gave conflicts and the user simply solved everything by accepting only his changes (refusing all other changes to the dev branch). In addition, I would open a new branch from develop and make a Cherry-pick from each commit from the old branch (excluding merges, of course) to the new branch.

  • So I believe that’s exactly what happened, too. I ended up choosing to make Herry-pick the differences and doing a hell of a job of "de-stop" with these branchs. Anyway, thanks for the answer, I’ll keep doing it even then, I was on the right track

1 answer

1


Paulo, when weird situations like this happen with Git, you need to know which commands were used.

From what you described, it seems that the merge done in the branch gave conflicts and the user simply solved everything by accepting only his changes (refusing all other branch changes dev).

Otherwise, I would open a new branch of dev and would make a cherry-pick of each commit from the old branch (excluding merges, of course) to the new branch.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.