Reputation: 15555
I wanted to create a PR on a new target branch but Im getting an conflict because the old feature branch is created using old target branch and creating a PR to new branch will create an error.
so I am doing these steps:
My question is how can I squash all commits into one commit ?
Upvotes: 0
Views: 38
Reputation: 1327084
my question is if i have two commits how can i squash them into one commit so that I can use cherry-pick to that commit ?
As mentioned in "How do I squash my last N commits together?", with a combination of reset --soft
+commit
:
git switch oldTargetBranch
git reset ‒soft commitBeforeYourTwocommits
git commit -am "squash old branch"
git switch newTargetBranch
git cherry-pick oldTargetBranch
Upvotes: 2