0

There are three branches in the repository, master, develop, migration. The feature branches are merged to migration branch, then migration is merged to develop and develop merged to master. What I have done, instead of creating the feature branches out of migration branch, I have created feature_branch_B out of feature_branch_A. Now when I create a PR for feature_branch_B, previous commits are added with the new commits of this branch. I don't know to which branch these extra commits belongs to.

In the image below the top 36 commits are appearing every time i create A PR from feature_branch_B. Why are they appearing and if its not normal how do I resolve it?

enter image description here

Tasif
  • 79
  • 1
  • 3
  • 12
  • Your description could use some work. Please don't call different things by the same name in your description, at least go with feature-branch-1 feature-branch-2 instead of making it clear you call multiple different things feature-branch. Is it the second feature branch (feature-branch-2) you are trying to merge into develop? – Kim Oct 20 '22 at 06:36
  • https://stackoverflow.com/search?q=%5Bgithub%5D+Old+commits+in+pull-request – phd Oct 20 '22 at 06:53
  • > "In the image below the top 36 commits are appearing every time.How do I remove these?" Do you really wont to know how to remove these or do you want to _understand why_ they appear? Please clarify your question. This is totally normal git behaviour. – Clijsters Oct 20 '22 at 06:53
  • @Kim i have changed the description – Tasif Oct 22 '22 at 09:07

1 Answers1

1

You need to rebase the feature branch so that the previous feature branch that it was based on is not part of its history.

git rebase previous-feature-branch feature-branch --onto develop
eftshift0
  • 26,375
  • 3
  • 36
  • 60