Hands-on task
Transplant commits with rebase --onto
In the /root/repo repository there is a main branch (commits base, m1, m2) and a topic branch that forked off main before m2 and contains three of its own commits: t1, t2, t3 (each adds a file of the same name: t1.txt, t2.txt, t3.txt).
You need to transplant onto the tip of main only the last two topic commits — t2 and t3, dropping the t1 commit entirely. After the operation, the topic branch should sit on top of main (contain m2.txt, t2.txt, t3.txt), and the file t1.txt should not be in it.
- git rebase --onto
- transplanting commits
- relative references
- topic~N
- branch point