Mixing gt and git
Under the hood, gt uses native git commands and stores all of the metadata on your stacks in the .git folder in your repo. We intend gt to entirely replace git in your workflow, but if you ever need to do something more advanced, you can always jump back to git and then sync your changes with Graphite.

Git passthrough

Graphite's CLI features a git passthrough - gt will pass any unrecognized commands thru to git, so you can run commands like gt status or gt remote, even though they aren't native commands in gt.
Git passthrough helps to avoid confusion about when to use gt vs. git - you can (and should) use gt for everything! For commands like gt branch which differ from their git equivalents, we recommend using the gt version to automatically keep your stacks in sync.

Fixing your stacks when you use git

If you end up using git instead of gt to create a branch or commit and want to make sure it's properly tracked in Graphite, you can do the following to make sure your stacks are up-to-date:
1
# update your local repo to account for branches or commits created outside of Graphite
2
gt stack fix --rebase
3
4
# abbreviated, this is:
5
gt sf --rebase
Copied!
gt stack fix --rebase will automatically update PRs and commits created outside of gt to reflect Graphite's record of your stacks - i.e. if you create a new branch or commit mid-stack and then run gt stack fix --rebase, Graphite will rebase the upstack changes to prevent your stack from forking.

Regenerating your stacks from git

If you're a power user who wants to update your local repo using git and then rebuild Graphite's record of your stacks based on the dependencies of your git branches, you can run the following command:
1
# update Graphite's record of your stacks to match your git repo
2
gt stack fix --regen
Copied!
gt stack fix --regen will update Graphite's record of your stacks to reflect branch dependencies in your git repo - i.e. if you create a new branch or commit mid-stack and then run gt stack fix --regen, Graphite's record of your stacks will now show that you've intentionally added a fork in your stack.