This message was deleted.
# how-do-i
s
This message was deleted.
✅ 1
p
Hey there! Generally when a branch gets corrupted
gt branch track
should do the trick - what are the rebase issues you're running into with upstack onto?
j
So the upstack command looks to re-apply all the commits, so that each commit ended up with a merge conflict 😞
j
hmm, you shouldn't need to
gt uso
in a case like this —
gt branch track --parent C
should have worked without needing to rebase every commit in D
j
Oh! I didn’t know about the
--parent
flag, I can try that next time 🙇
One more question – the way I managed to corrupt this branch was by trying to consolidate commits (not squashing all of them, but just a few). I stupidly rebased over
main
instead of
C
, is there an interactive squash where I can pick the commits I want to squash together? E.g.
Copy code
pick Initial commit
pick PR comments
squash Oops
squash asdf
squash Can't believe I did that
j
I would recommend just using a standard interactive git rebase for this
👍 1
if you have upstack branches you can always use
gt upstack restack
afterwards
as long as you don't rebase past the "beginning" of the branch your graphite metadata is safe
j
Understood 🙇 That makes sense
j
(back to the
branch track
thing) The
--parent
flag only works when the parent is in the branch being tracked's history, in some cases you may need to use a
rebase --onto
to make that happen before running
track
— we can improve this by having branch track let you interactively select which commits to include as part of the branch and automatically do that
rebase --onto
for you
j
Ah, good to know! Yes that would be great to be able to interactively select the commits