Skip to content

Concepts

git-spice introduces a few concepts on top of Git. This section lists a few that are frequently used in the documentation.

main A B C D E Upstack Downstack Stack Current branch Trunk F Sibling
Branch

A regular Git branch. Branches can have a base: the branch they were created from. The branch currently checked out is called the current branch.

In the diagram, B is the current branch, and A is its base.

Trunk
The default branch of a repository. This is "main" or "master" in most repositories. Trunk is the only branch that does not have a base branch.
Change Request
Change Request refers to a single merge-able unit of work submitted to GitHub or GitLab. Each Change Request corresponds to a branch. On GitHub, these are called Pull Requests, and on GitLab, they are called Merge Requests. Since git-spice supports both platforms, the term Change Request is used to refer to both.
Stack

A stack is a collection of branches stacked on top of each other in a way that each branch except the trunk has a base branch.

In the diagram, A is stacked on top of trunk, B is stacked on top of A, and so on. A branch can have multiple branches stacked on top of it.

Downstack
Downstack refers to the branches below the current branch, all the way to, but not including, the trunk branch.
Upstack
Upstack refers to the branches stacked on top of the current branch, those branches' upstacks, and so on until no more branches remain. If a branch has multiple branches stacked on top of it, they are both upstack from it.
Sibling
A sibling to a branch is a branch that shares the same base branch. In the diagram, F is a sibling to B, and C is a sibling to D.
Restacking
Restacking is the process of moving a rebasing the contents of a branch on top of its base branch, which it may have diverged from. This is done to keep the branch up-to-date with its base branch, and maintain a linear history.