Starting at the trunk branch, any number of branches may be stacked on top.
git-spice learns about the relationships between branches by 'tracking' them
in an internal data store.
Branches may be tracked manually or automatically:
This will create a new branch stacked on top of the current branch,
commit the staged files to it, and track it with the current branch as base.
An editor will open to let you write a commit message
if one was not provided with the -m/--message flag.
But I use git commit -a
If you prefer to use git commit -a to automatically stage files
before committing, use gs branch create -a to do the same with git-spice.
If you prefer a workflow where you create branches first
and then work on them,
you can configure git-spice to never commit by default.
See Create branches without committing.
git-spice does not require to change your workflow too drastically.
If you prefer to use your usual workflow to create branches and commit changes,
use gs branch track to inform git-spice of the branch after creating it.
$ git checkout -b feat1# make your changes$ git commit$ gs branch trackINF feat1: tracking with base main
We advise picking descriptive names for branches.
You don't need to remember the exact names as git-spice provides
a number of utilities to help navigate and manipulate the stack.
Most places where a branch name is required provide
shell completion and fuzzy-searchable lists.
Can't think of a branch name?
If you can't think of a name for a branch,
run gs branch create without any arguments.
git-spice will use the commit message to generate a branch name for you.