Skip to content
kain88-de edited this page May 4, 2024 · 116 revisions

How to configure

git-branchless is configured using git config.

Example: run git config branchless.core.mainBranch foo to set the main branch to foo for the current repository.

Example: run git config --global branchless.core.mainBranch bar to set the main branch to bar for all repositories on your machine. (You must still run git branchless init in each repository individually.)

Core

branchless.core.mainBranch

Type: string. Default: master.

Denotes the "main" branch for the repository. Learn more...

Note: prior to git-branchless v0.3.2, this configuration option was called branchless.mainBranch.

Note: prior to git-branchless v0.6.0, it was possible to use a remote branch as the main branch. This is no longer supported.

Example: Github uses main as the main branch name for new repositories. To configure git-branchless to handle this, you can run

git config branchless.core.mainBranch main

Revsets

branchless.revsets.alias.<key>

See https://github.com/arxanas/git-branchless/wiki/Reference:-Revsets#aliases.

Smartlog

branchless.smartlog.defaultRevset

Available since v0.8.0.

Type: revset. Default: ((draft() | branches() | @) % main()) | branches() | @.

In the smartlog, if no revset is provided, this revset is used by default. This is also used in a few places where the smartlog is printed implicitly, such as after an invocation to git next.

branchless.commitMetadata.branches

Type: bool. Default: true.

In the smartlog, for each commit, render the list of local branches which point to it.

branchless.commitMetadata.differentialRevision

Type: bool. Default: true.

In the smartlog, for each commit, if it appears to be linked to a Phabricator Differential revision, render it (such as D12345).

branchless.commitMetadata.relativeTime

Type: bool. Default: true.

In the smartlog, for each commit, display approximately how long ago it was committed (such as 1d ago).

Restack

branchless.restack.preserveTimestamps

Type: bool. Default: false.

Running git restack normally sets the "committed" timestamp for any restacked commits to the current time. Setting this to true causes git restack to instead set their committed timestamp to their original "authored" timestamp.

branchless.restack.warnAbandoned

Type: bool. Default: true.

After rewrite operations (rebases, amends, cherry-picks, etc.), warn if a child commit was abandoned. A commit is considered abandoned if it is visible but its parent commit has been rewritten. It can then be fixed up with git restack.

Next

branchless.next.interactive

Type: bool. Default: false.

If true, then running git next will default to using interactive ambiguity resolution (--interactive) when there are multiple next commits to choose between.

Undo

branchless.undo.createSnapshots

Type: bool. Default: true.

If true, then potentially-destructive operations will create working copy snapshots before proceeding. This improves the git undo experience, but introduce additional latency for some operations in repositories with large working copies.

Navigation

branchless.navigation.autoSwitchBranches

Type: bool. Default: true.

If true, switch to the branch associated with a target commit instead of the commit directly. The switch will only occur if it is the only branch on the target commit. This affects commands like prev, next, and co --interactive

Clone this wiki locally