0

I have 4 branches (dev, main, example1, example2) and I am trying to create a pull request to pull example1 into main.

What is happening?

First I created a pull request to pull example2 into dev then I created a pull request to pull example1 into dev.

example1 branch now has also the example2. When I pulled example1 into dev it also merged the example2 into example1.

Why is this happening?

So, if I try to pull example1 into main it is sending both, example1 and example2.

Anyone knows why is this happening? Is there any way, in this case, to unmerge the dev branch on example1?

Thanks

Tried to create pull requests separetely.

  • 1
    Probably what you think happened didn't really happen. When you merge example1 into dev, that merges example1 into dev. When you merged example2 into dev, that merges example2 into dev. This is all that happens. If you think otherwise, you need to provide details that illustrate the problem. Make sure, for instance, that no one has previously merged example2 into example1. Or that even someone did the same code changes on both branches independently. To "unmerge", see this site for help: https://sethrobertson.github.io/GitFixUm/fixup.html – topsail Jan 30 '23 at 22:06
  • 1
    My guess is that when you created example 2, you branched from example 1. So it's part of example 1. I would try to attach a git graph of your branching in the post and show the structure. – Rafael Moreira Jan 30 '23 at 22:37
  • both example1 and 2 has the branch main as base. Im pretty sure that I havent merge one on another. Also I checked on git that when I created the pull request to merge the example1 into dev it also create automatically a merge from dev into example1 and it put the branch example2 into example1 as it was in dev branch. It is also happing with other devsin the company I work @topsail – Guilherme Migliano Jan 30 '23 at 23:04
  • Waht give you git merge-base example1 example2 , git merge-base example1 main , git merge-base example2 main – Ôrel Jan 30 '23 at 23:09
  • Are there merge conflicts in your merge of "example1" into "dev"? Before you say no, are you sure? Can you give more detail about this, or even create a reproducible example? – topsail Jan 31 '23 at 02:56
  • 1
    To view how branches are related on your local repo, run: `git log --graph --oneline main dev example1 example2` – LeGEC Jan 31 '23 at 05:07

0 Answers0