This message was deleted.
# announcements
s
This message was deleted.
❤️ 6
m
I had some branches I was working with before downloading the Graphite CLI, and I was able to convert them.
gt branch track
Then as I go about changing things on each branch and rewriting history, they get out of sync with each other. But I can get them chained again using
gt upstack restack
I'm still wrapping my head around the
up
and
down
parts. My intuition is backwards of the analogy, thinking
up
is old and
down
is new. But the
stack
analogy is that the bottom/`down` is the origin and new branches are stacked
up
on top. So
upstack
means child branches. and
downstack
(which I haven't used on the CLI) means parent branches. [edit] documentation explanation of `up`/`down`:
Upstack: Branches further away from
main
in a stack (more recent; descendants; recursive children). Commands within the "upstack" noun operate on a branch and descendants.
Downstack: Branches closer to
main
in a stack (less recent; ancestors; recursive parents). Commands within the "downstack" noun operate on a branch and its ancestors.
via https://graphite.dev/docs/familiarizing-yourself-with-gt
n
I too find the stack direction a little confusing. Here's a snippet from
gt --help
Copy code
gt upstack <command>    Commands that operate on a branch and its descendants.
  gt downstack <command>  Commands that operate on a branch and its ancestors.
Normally "descendants" go downward, and in a normal family tree picture the ancestors go upward. I don't suppose there's a config flag to switch the direction? 😉
👀 1
m
Just tried
gt log
and I love the output. Normally, I
git switch
branch by branch and do a
git log --oneline develop..mybranch
which shows me pretty clean output. But
gt log
does it for me for multiple stacked branches.
n
^^ agreed -
gt log
output is 💯
1
m
looks like
gt ur
does not exist as a short form of
gt upstack restack
https://graphite.dev/docs/restacking-branches I'm not sure what
gt stack restack
would do since it doesn't say
up
or
down
. Will have to try it sometime. excerpting CLI
--help
output:
Copy code
$ gt stack --help

  index.js stack restack         Ensure each branch in the current stack is
                                 based on its parent, rebasing if necessary.
                                                            [aliases: r, fix, f]
Copy code
$ gt upstack --help

  index.js upstack restack         Ensure the current branch and each of its
                                   descendants is based on its parent, rebasing
                                   if necessary.            [aliases: r, fix, f]
Copy code
$ gt downstack --help

  index.js downstack restack         From trunk to the current branch, ensure
                                     each is based on its parent, rebasing if
                                     necessary.                     [aliases: r]
m
Cc @Jacob Gold we should add this one
j
gt usr
👀 1
and
stack restack
will restack everything from the trunk branch up to the descendants of the current branch - i.e. both
downstack restack
and
upstack restack
👀 1
@merrill add what?