-2

I had a parent branch and a child branch created from the parent branch. After merging the parent branch to the master, the branch was deleted. I've made some more changes in child branch and when I created the pull request, I can see the commits of the parent branch in the child branch. How can I change the starting commit of the child branch?

To be more clear, the following depicts the current situation and I wish to remove P1 and P2 from the commits shown when trying to create a PR from child_branch to master.

enter image description here

S.Dan
  • 1,826
  • 5
  • 28
  • 55

1 Answers1

1

You probably want to rebase child_branch on top of master :

# from child_branch :
git checkout child_branch

# run :
git rebase master

git will spot that all commits up to P2 are already part of master, and will replay one by one the commits in the range P2..child_branch

LeGEC
  • 46,477
  • 5
  • 57
  • 104