GitMasterDocs

Reference

Configuration Partly available

GitMaster keeps little configuration of its own. Git options and app preferences both live in Git's configuration files, as gitmaster.* keys, so they can be tracked with your dotfiles and overridden per repository. State about a repository stays in that repository's Git directory. GitMaster never writes into the working tree of a repository.

Where GitMaster stores data#

GitMaster keeps its files in three places: your user config directory, your user data directory, and the Git directory of each repository. Nothing is written into a repository's working tree, so no .gitignore entry is needed and no file appears as changed.

User config directory#

PathWhat it holdsStatus
~/.config/gitmaster/workflows/ (Linux), ~/Library/Application Support/gitmaster/workflows/ (macOS)Your workflow files. A workflow file holds only its definition, never run state.

User data directory#

PathWhat it holdsStatus
~/.local/share/gitmaster/recent.json (Linux), ~/Library/Application Support/gitmaster/recent.json (macOS)The recently opened repositories, newest first, up to 10.
~/.local/share/gitmaster/gitmaster.db (Linux), ~/Library/Application Support/gitmaster/gitmaster.db (macOS)Which versions of a workflow script you reviewed, and your automatic approvals. Each is tied to the hash of the script text.
~/.local/share/gitmaster/workflow-trash/ (Linux), ~/Library/Application Support/gitmaster/workflow-trash/ (macOS)Workflow files you delete. They are moved here instead of being removed.
~/.local/share/gitmaster/contexts.db (Linux), ~/Library/Application Support/gitmaster/contexts.db (macOS)Your contexts: their names, nesting and repositories, and the memories attached to them, with a search index. Readable only by you.Planned

A repository whose folder no longer exists is dropped from the recent list.

Inside each repository#

GitMaster keeps per-repository state in .git/gitmaster/, inside the Git common directory. In a linked worktree, that is the common directory shared by all worktrees of the repository, so every worktree sees the same state. To find it, run git rev-parse --git-common-dir.

PathWhat it holdsStatus
.git/gitmaster/state.dbWorkflow run history: every run and every call it made.
.git/gitmaster/review.dbThe comments of the local review and their states. Their snapshots are kept in refs/gitmaster/review/.
.git/gitmaster/threads.dbThe threads captured from agent sessions in this repository: conversation, tool calls and edits, with a search index. Readable only by you.
.git/gitmaster/repo-idA random id for this clone, written when the repository first joins a context, so the membership survives moving the folder.Planned
.git/gitmaster/threads-spool/, threads-tmp/, threads.logEvents waiting to be written when the database was busy, temporary copies of files the agent is about to edit, and the capture log. The log keeps at most 256 KiB.
.git/gitmaster/restack.jsonThe record of the last restack, which Undo restack reads to put the branches back.
refs/gitmaster/ (private refs in .git)Snapshots of the local review and of file moves, and the conflict resolutions of restacks. These refs are not branches, so git branch does not list them.

The Git command log, the list of Git commands with side effects that the Git commands panel shows, is kept in memory only. It keeps the last 1000 commands and is lost when the app closes.

Preferences#

GitMaster keeps its own preferences as gitmaster.* keys in Git's configuration. Put your base values in ~/.gitconfig, so they are tracked with the rest of your dotfiles, and override them in one repository with git config or by editing its .git/config. Git's rules apply: the system file, then ~/.gitconfig, then the repository's .git/config, then the worktree's config, and each later layer wins. include and includeIf work too, so a work repository can take a different set from a personal one.

# ~/.gitconfig
[gitmaster]
	diffLayout = split
[gitmaster "threads"]
	maxResultBytes = 131072
	redactPath = .env
	redactPath = secrets/**
[gitmaster-redact "acme-token"]
	regex = acme_[A-Za-z0-9]{32}
git config --global gitmaster.diffLayout split   # for every repository
git config gitmaster.threads.capture false       # for this repository only

When you change a preference in the app, it is written to ~/.gitconfig (git config --global). Only a value that differs from the default is stored, and a value that goes back to its default is removed, so the file holds only what you chose. The app never changes a repository's .git/config, so an override you wrote there stays and wins. A repository's preferences are read when its window opens.

KeyValuesDefaultMeaning
gitmaster.diffLayoutunified, splitunifiedThe layout of the diff, set by the Unified or Split selector. The choice applies to the Working Copy diff and to the commit diff.
gitmaster.authorPicturesbooleanfalseWhether author pictures are looked up on Gravatar.
gitmaster.threads.capturebooleantrueTurns thread capture off when false.
gitmaster.threads.maxResultBytesinteger65536The most bytes of one tool result that are stored. A longer result is cut, and the entry records its original size.
gitmaster.threads.redactBuiltinbooleantrueTurns the built-in redaction patterns on or off as a group. Leave it on unless you replace them with your own.
gitmaster.threads.redactDisabledBuiltinname, can be set more than oncenoneA built-in pattern to turn off, for example jwt. A name that is not a built-in pattern is ignored with a warning.
gitmaster.threads.redactPathglob, can be set more than once.env, .env.*, *.pem, id_rsa*A glob on repository-relative paths. The content of a matching file is never stored; the path is.
gitmaster-redact.<name>.regexregular expressionnoneA redaction pattern of your own. <name> is the label in [REDACTED:<name>].
gitmaster-redact.<name>.groupinteger0The capture group that holds the secret. 0 is the whole match. Use a group to keep a readable name, as in (password=)(\S+) with group set to 2.

The agent integration reads these keys each time a hook runs, from the repository the event comes from, so a change applies to the next event. A pattern <name> uses letters, digits, - and _, and it must not repeat a built-in or another pattern. The regular expression has the syntax of Rust's regex crate and matches in linear time, so a pattern cannot make the hook hang. A pattern that is not valid pauses capture in every repository until it is fixed. See Secrets.

Rules for lists and patterns:

  • A key that can be set more than once adds up across the layers, as Git's own lists do. A repository adds its entries to the global ones.
  • An empty value clears what the layers below it set. redactPath = in a repository removes the global paths; add your own after it. A single redactPath = in ~/.gitconfig means no paths at all.
  • A pattern whose regex is empty is dropped, so a repository can turn off a global pattern with [gitmaster-redact "acme-token"] and regex =.
  • Git reads a backslash in a value as an escape. Write \\d for the regular expression \d, or let git config gitmaster-redact.acme.regex '\d+' write it for you.
  • A value that is not valid, such as maxResultBytes = lots, reads as the default.

Git configuration keys#

GitMaster reads Git's own configuration through git, so Git's scope rules apply. A key set in ~/.gitconfig applies to every repository, and a key set in .git/config applies to one repository only. The Scope column says where a key can be set: Any means global or repository.

KeyScopeDefaultUsed forStatus
core.editorAnyNot setThe program that Open in editor starts.Planned
merge.conflictStyleAnyzdiff3The style of the conflict markers the conflict resolver shows.Planned
gitmaster.workflowPathAny, can be set more than onceNot setExtra folders to read workflow files from, after your workflows directory. A folder inside the repository's working tree is ignored, with a warning.
gitmaster.worktree.rootAny../<repo>-<branch>The base folder for new worktrees. gitmaster worktree add reads it; see Command line. The worktree dialog does not read it yet.Planned
gitmaster.worktree.includeAnysymlinkHow gitmaster worktree add brings the paths of .worktreeinclude into a new worktree: symlink, reflink or none. See Command line.
gitmaster.workspace.rootAny~/workspacesThe base folder for new workspaces.Planned
branch.<name>.stackParentRepositoryNot setThe parent branch of a branch in a stack. See Stacks.
branch.<name>.stackParentBaseRepositoryNot setThe commit the parent branch pointed to when this branch was last created or re-anchored.

The branch.<name>. keys belong to stacks, which is a preview feature. See Preview features.

Environment variables#

VariableValuesEffect
GITMASTER_THEMEdark, light, systemSets the theme when the app starts. The value is not case sensitive. When it is unset, or set to any other value, the theme is system, which follows the appearance of your operating system.
SHELLPath to a shellThe shell that GitMaster asks for the PATH. See below.
XDG_CONFIG_HOMEAbsolute pathThe base of the user config directory on Linux. Defaults to ~/.config. A relative or empty value is ignored.
XDG_DATA_HOMEAbsolute pathThe base of the user data directory on Linux. Defaults to ~/.local/share. A relative or empty value is ignored.
HOMEAbsolute pathThe base of the default folders when the XDG variables are not set. On macOS, the folders are always under Library/Application Support in your home directory.
GITMASTER_ENABLE_STACKS1, 0, or unsetTurns the stacks preview feature on or off. See Preview features.
GITMASTER_ENABLE_CONFLICT_RESOLVER1, 0, or unsetTurns the conflict resolver preview feature on or off. See Preview features.

Login-shell PATH#

A window opened from a desktop launcher, the Finder or the Dock starts with a minimal PATH. Git and the tools your shell profile adds, such as Homebrew's, may then not be found. To avoid this, GitMaster reads the PATH of your login shell once, in the background, when the app starts:

  1. GitMaster runs the shell named by SHELL as a login, interactive shell that prints its environment.
  2. It waits up to 10 seconds. A shell that takes longer is stopped.
  3. If the shell prints a PATH, Git and the other programs GitMaster starts after that point run with it. These are the file watcher and the programs that workflows start with ctx.exec.

Programs started before the PATH is read use the PATH the app started with. If SHELL is not set, the shell does not answer in time, or it prints no PATH, GitMaster keeps the PATH it started with. GitMaster does not change its own environment variables to do this.

Preview features#

Some areas are finished in the code but not yet part of the release. A preview feature is hidden in the release build. Each one has its own environment variable, which turns it on or off when GitMaster starts:

VariableFeatureWhat it shows
GITMASTER_ENABLE_STACKSStacks and restackThe by-stack view, the stack actions, restack and the stack marks in the graph. See Stacks.
GITMASTER_ENABLE_CONFLICT_RESOLVERConflict resolverThe conflict resolver, which resolves a file's conflicts by hand. See Conflicts.

The name of the variable is the id of the feature in capitals, with - replaced by _.

Values#

ValueEffect
1, true, on or yesThe feature is on.
0, false, off or noThe feature is off.
Unset, or emptyThe default of the build applies.

The value is not case sensitive, and spaces around it are ignored. A value that is not in this table prints a warning on stderr, and the default of the build applies. A variable that starts with GITMASTER_ENABLE_ and names no feature prints a warning and has no effect. Each variable changes only its own feature.

Build defaults#

A release build has every preview feature off. A build made with make build, make run or make install has every preview feature on. The variables override these defaults.

Examples#

Turn stacks on in the release build:

GITMASTER_ENABLE_STACKS=1 gitmaster

Turn the conflict resolver off in your own build, to see what users get:

GITMASTER_ENABLE_CONFLICT_RESOLVER=0 gitmaster

Check which preview features are on with gitmaster --version. When one or more are on, it prints a second line, preview features:, followed by their ids, such as preview features: stacks. See Command line.

Settings dialog#

Open the settings dialog with Ctrl+, (⌘, on macOS), with Open Settings in the command palette, or with the gear button at the bottom of the window. The dialog is centered over the window, and the rest of the window is dimmed. Close it with Esc, a click outside it, or its close button. The categories are on the left, and the form for the selected category is on the right.

Changes apply as you make them, and there is no Save button. A value is saved when you change it, and a text field is saved when it loses focus. A value that is not valid is flagged inline and is not saved. Each change goes to the right place:

  • Git options go to Git's configuration. The scope selector sets where they go: Global writes to ~/.gitconfig, and This Repository writes to .git/config.
  • App preferences go to ~/.gitconfig as gitmaster.* keys, whatever the scope selector says.
  • Workflow reviews and automatic approvals go to your user data directory.
  • Nothing is written to the working tree.

General#

FieldWhat it does
AppearanceSets the theme to System, Dark or Light.
TypographySets the font families for the interface and for code. Each choice shows a preview.
Recent RepositoriesLists the recently opened repositories. You can remove one entry or clear the list.
File WatcherSets the maximum number of directories the file watcher follows, and shows whether it has fallen back to refreshing on focus.

Git & Identity#

FieldWhat it does
Scope SelectorChooses Global or This Repository for the fields below.
Author DetailsSets user.name and user.email.
Default BranchSets init.defaultBranch, the name for new branches and new repositories.
EditorSets core.editor, the program that Open in editor starts.
SigningShows whether commits are signed (commit.gpgSign) and which GPG or SSH key signs them.

Worktrees#

FieldWhat it does
Default LocationSets the base folder for new worktrees (gitmaster.worktree.root). The default is ../<repo>-<branch>.
Safety RulesShows the rules for removing worktrees that have unpushed commits, uncommitted changes or a lock. See Worktrees.

Diff & Files#

FieldWhat it does
AlgorithmChooses the diff algorithm: histogram (the default), myers or patience.
ContextSets the number of context lines around each hunk (diff.context).
Display OptionsIgnores whitespace changes by default (ignore-space-change), and turns line wrap on or off.

Stacks & Restack#

FieldWhat it does
Restack with Dirty Working TreeSets what restack does when the working copy has uncommitted changes. See Stacks.
Push StrategySets how restacked branches are pushed. The default is push with lease.

Conflict Resolver#

FieldWhat it does
Conflict StyleSets merge.conflictStyle, the style of the conflict markers. The default is zdiff3.
Git rerereTurns the reuse of recorded conflict resolutions on or off. See Conflicts.

MCP & Agents#

The MCP server is started by your agent with gitmaster mcp, so it has no switch, socket or token to set. Which tool calls ask for your approval is set in your agent's permissions. See MCP server.

Threads#

The settings dialog is not available yet, so these fields are edited today in Threads Settings…, which has the same fields.

FieldWhat it does
Capture ThreadsTurns capture on or off everywhere.
Built-in PatternsLists the built-in redaction patterns, each with a switch.
Your PatternsAdds, edits and removes your own patterns. An invalid pattern is flagged inline and pauses capture until it is fixed.
Sensitive PathsEdits the list of paths whose content is never stored.
TestShows the result of redacting a sample text with the current patterns.
Result SizeSets the most bytes of one tool result that are stored.

Reviewers#

FieldWhat it does
ReviewersLists your reviewers. Each has instructions, a signal, a direction, a subject and an optional model. See Reviewers and gates.
GatesSets which gates apply to a push and to a restack, for each branch or for all of them.

Local Review#

FieldWhat it does
StorageShows where review comments and local snapshots are stored. See Local review.

Workflows#

FieldWhat it does
DirectoriesShows the folders that workflows are read from: your workflows directory and the folders in gitmaster.workflowPath.
Enabled per RepositoryChooses which workflows run in each repository. Your own workflows are on unless you switch them off; the built-in stack workflows are off unless you switch them on.
Automatic ApprovalsLists the approvals that let a workflow run without asking again. Each approval is tied to one script hash. Use Revoke to remove an approval. See Approvals and security.
Run HistoryKeeps the last 200 runs of each workflow in each repository. An output larger than 64 KiB is stored as its hash, its size and its first 4 KiB.
GitMaster documentation · e66d34c