Skip to content
claytonrcarter edited this page Aug 23, 2022 · 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.

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

Example: if you don't want to have a remote-tracking master branch in your repository at all, and base your work directly off of the remote repository's master branch, you can run

git config branchless.core.mainBranch origin/master
git branch -d master

Smartlog

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.

Clone this wiki locally