gtwill pass any unrecognized commands thru to
git, so you can run commands like
gt status, even though they aren't native commands in
git add: Stage files to be committed;
-pis helpful for precise cases.
git stash: Save changes for later (retrieve with
git stash pop). Since restacking requires the working tree to be clean, stashing changes you don't intend to commit is often necessary while using
-poption is just like
git diff: See what has changed between two branches.
git status: Keep track of your worktree and staging area, just like
git rebase: Useful for preparing branches created outside of Graphite to be tracked (see below). Also potentially dangerous (see further below).
gitcommands as a
gt upstack restackon each child will rebase descendants such that they have the new version in their history. We specify simple here because there is some nuance to using
git rebase— see below for details.
gtto create a branch, you need to let
gtknow what its parent is. That's what
gt branch trackis for. When run, it prompts you to select a parent for the current branch from the branch's Git history.
gt branch track --forceskips the prompt and chooses the nearest ancestor that is already tracked. See the command
--helpfor more options.
gt downstack trackallows you to track multiple branches recursively. Run it from the tip of a stack to track the entire thing by selecting the parent of each branch until you reach a branch that is already tracked. The
--forceflag chooses the nearest ancestor of each branch as its parent.
gt branch untrackcommand that you can use to stop tracking a branch without deleting it from
git. Note that this will also result in all descendants of this branch becoming untracked as well; to avoid this, use
upstack ontoto move them onto a new parent first (learn more about
git rebasethat removes that commit from the branch's history, your branch and its children may suddenly become untracked! In order to bring the branch back into Graphite, you will need to ensure the branch is correctly based on its parent, and then use
gt trackto fix its metadata.
git rebase -ion the commits of a branch is safe, although we provide a convenience command for this called
gt branch editthat runs an interactive rebase followed by
upstack restackon each child of the branch.