This message was deleted.
# how-do-i
s
This message was deleted.
a
not with graphite but tbh you could probably fix the status by force pushing your branches from local and overriding the github branches, then using the graphite GUI to merge all three at once
n
yeah, The force push is so scary. I'm always afraid I'm gonna overrwrite something by accident. Especially right now, since branch 2 locally doesn't seem to have the changes in it that I expect
a
hmm if it’s less scary for you, you could make copies of your local branches with
git branch
and then push those!
that way you don’t lose any data and still are able to recover from state
then once everything is merged delete the old branches when not useful
n
I guess you're saying that I would push BOTH the 2nd and 3rd branches again.
That makes sense I suppose.
a
yep! Basically make new branches in github and then track those with graphite after
n
any idea why what I did messed it up in the first place?
I wouldn't have really thought I was doing anything odd here
a
I’m kinda giving you the “turn it off again and on again” advice which isn’t very satisfying I know but with Git and losing changes its generally the best advice I’ve seen work 100% of the time
Most likely it’s because of
rebasing
is a really tricky thing to get right and you technically messed with the time history when trying to move things around. Git is smart but not super smart so sometimes it tries to “just work” when it doesn’t really know the answer
n
But I don't see when I tried to move anything around. It feels like I did everything the way you're expected to do it in graphite
Anyway, I see how what you're suggesting should work
thanks
a
Graphite seems to suggest merging from the bottom to the top, which with rebasing makes a lot of sense, although my intuition as well originally was merging from top to bottom. I think the reason they do from bottom to top is to solve for this problem 😢
nw! Happy to help hopefully this fixes it for ya
s
Locally, if I diff the 2nd and 3rd branches, it looks like the 3rd was never merged into the second. I would expect to see no changes.
gt repo sync
updates the main branch and checks if anything has been merged into it. It doesn’t check all the other branches. (I guess it assumes that you will always merge them starting with the most downstack branch.)
n
That's helpful. I didn't realize that was the case
s
I would fold the third branch into the second one (
gt bco 3rd; gt branch fold
). That way your local state matches GitHub. Then
gt ss
to re-submit to GitHub
👍 1
a
Even better GT solution lets go
j
fwiw — force pushing to github is relatively safe because github doesn't garbage collect the old force pushed versions
👍 2