I was trying to really understand some rebase stuff, and was really stuck on this snippet:
git rebase --onto topicA~5 topicA~3 topicA
How would you explain it? How do you understand it?
I was trying to really understand some rebase stuff, and was really stuck on this snippet:
git rebase --onto topicA~5 topicA~3 topicA
How would you explain it? How do you understand it?
Here's a plain english attempt to re-explain it, for my own future reference.
Imagine this is the call signature:
git rebase --onto <base-commit-ish> <first-segment-HEAD> <second-segment-HEAD>
This will make <second-segment>
not dependent on <first-segment>
.
That is, you'll get a branch structure like this:
H'--I'--J' second-segment
/
| E---F---G first-segment
|/
A---B---C---D <base-commit-ish "D">
This is useful if you have stacked PRs, but want to "break out" one of the PRs as separate, so they can be independently merged.
If you have a large PR stack, a change is truly independently mergeable (no potential merge conflicts, etc), cherry-pick is a better option.