schube
schube

Reputation: 730

git: Merged two branches into each other - is this bad?

I accidentally merged two branches into each other. (If you want to know how I did that: With gitlab I merged branch A into branch B in the web interface and in SourceTree client I merged B into A. Stupid, I know...)

Then also, because I had to fix something real quick, I worked with the merged branch. It looks like this now:

Git merge A into B and B into A

Is this a problem? Why? Currently, everything seems to work correctly. Should I solve that merge? How can I solve it?

(Later I have to merge everything into "master". I hope there will be no problems.)

Thank you!

Upvotes: 3

Views: 1592

Answers (1)

Vampire
Vampire

Reputation: 38639

No, it is not a problem if the result is what you want, meaning both branches are identical now. You first merged the changes of the left branch into the right branch, so that the right branch has everything of the left branch plus its own commits, then you merged the changes of the right branch into the left branch, so that both have the same content now. If you wouldn't have used --no-ff option, then there would actually not have been a second merge commit, but simply the branch pointer of the left branch would have pointed to the same commit as the branch pointer of the right commit, which is the first merge commit.

Upvotes: 7

Related Questions