How do I create a new branch as the parent of the ...
# how-do-i
p
How do I create a new branch as the parent of the current branch?
gt create --insert
creates a new branch as a child of the current branch, but I want it to be inserted as a parent. Any ideas?
j
Hi Philip - try using
--onto
with the current branch’s parent:
gt create new-parent-branch --onto <current-parent> --insert
You can check the current parent with
gt log
. So if your stack is
main <- current-branch
, you’d run:
gt create new-parent-branch --onto main --insert
p
Aha, that's exactly what I was looking for. I'm still on 1.7.20 though, that's why I hadn't seen that option. Guess it's time to upgrade.
j
Happy to help!