gj (git-jump) uses a 4-level hierarchical configuration system. Settings defined at a higher
level (closer to the root) are inherited by all projects beneath them, and child configs can
override or extend parent settings.
~/.config/git-jump/config.toml # Global
$root/<domain>/.git-jump.toml # Domain
$root/<domain>/<group>/.git-jump.toml # Group
$root/<domain>/.../<project>/.git-jump.toml # Project
The global config holds machine-wide settings (root path, browser command, default logo).
The domain/group/project configs (.git-jump.toml) hold per-environment settings that are
merged as you descend the directory tree.
File: ~/.config/git-jump/config.toml
gj follows the XDG Base Directory Specification. If $XDG_CONFIG_HOME is set, the config
directory is $XDG_CONFIG_HOME/git-jump/; otherwise it defaults to ~/.config/git-jump/.
Run git-jump setup to create this file interactively.
Type: string (path)
Required: yes (or set $_GIT_JUMP_ROOT)
The root directory that contains all your organized Git projects. All domain directories live directly under this path.
root = "~/code"The $_GIT_JUMP_ROOT environment variable takes precedence over this field when set.
Type: string (shell command template)
Required: no
Custom browser command for git-jump browse. Use {url} as a placeholder for the target URL.
When not set, gj uses the system default browser.
browser = "firefox --new-tab {url}"browser = "open -a 'Google Chrome' {url}"Type: string
Required: no
Default ASCII art logo text rendered via FIGlet when switching environments. This is the lowest-priority fallback; domain/group/project configs override it.
logo_text = "dev"Projects are organized under the root directory in a domain/group/project hierarchy:
~/code/ # root
github.com/ # domain
.git-jump.toml # domain config
my-org/ # group
.git-jump.toml # group config (optional)
backend-api/ # project
.git-jump.toml # project config (optional)
.git/
frontend-app/
.git/
another-org/
data-pipeline/
.git/
git.example.com/ # another domain
.git-jump.toml
devops/
helm-charts/
.git/
terraform/
.git/
The domain component is the Git server hostname (e.g. github.com, git.example.com).
The group component maps to the organization or namespace on the server.
Subgroups are supported: domain/org/subgroup/project is a valid 4-component path.
Place a .git-jump.toml file at any directory level (domain, group, subgroup, or project) to
configure all projects beneath it. The file uses TOML syntax.
| Field | Global | Domain | Group | Project |
|---|---|---|---|---|
root |
yes | -- | -- | -- |
browser |
yes | -- | -- | -- |
logo_text |
yes | yes | yes | yes |
alias |
-- | yes | yes | yes |
web_url_template |
-- | yes | yes | yes |
git_config |
-- | yes | yes | yes |
env |
-- | yes | yes | yes |
hooks.on_enter |
-- | yes | yes | yes |
Type: string
Levels: domain, group, project
A short identifier for the directory. Aliases create an alternative path prefix for matching, tab completion, and the TUI selector.
alias = "work"Constraints:
- Must not be empty
- Must not contain
/or whitespace
With alias = "work" on a domain directory, the path git.example.com/backend/api becomes
accessible as work/backend/api in addition to its full path.
See Path Aliases for detailed behavior.
Type: string (URL template)
Levels: domain, group, project
URL template used by git-jump browse to construct the project web page URL. Supports
placeholder variables that are substituted at runtime.
# GitHub
web_url_template = "https://{domain}/{groups}/{project}/tree/{branch}/{path}"
# GitLab
web_url_template = "https://{domain}/{groups}/{project}/-/tree/{branch}/{path}"
# Bitbucket
web_url_template = "https://{domain}/{groups}/{project}/src/{branch}/{path}"
# Custom server with non-standard port
web_url_template = "https://{domain}:8443/{groups}/{project}"
# Project home page only (no branch/path)
web_url_template = "https://{domain}/{groups}/{project}"See URL Template Variables for the full variable reference.
Merge rule: child overrides parent.
Type: table (key-value pairs)
Levels: domain, group, project
Git configuration key-value pairs applied automatically via git config each time you jump to
a project. Useful for setting per-domain identity (name, email, signing key).
[git_config]
"user.name" = "Your Name"
"user.email" = "you@company.com"
"commit.gpgsign" = "true"
"user.signingkey" = "ABCDEF1234567890"Note: dotted keys (e.g. user.name) must be quoted in TOML.
Merge rule: same key -- child overrides parent; different keys -- merged from all levels.
Type: table (key-value pairs)
Levels: domain, group, project
Environment variables exported into the shell each time you jump to a project.
[env]
GOPATH = "/home/you/go"
KUBECONFIG = "/home/you/.kube/work-config"
AWS_PROFILE = "work"Merge rule: same key -- child overrides parent; different keys -- merged from all levels.
Type: array of strings (shell commands)
Levels: domain, group, project
Shell commands executed in the parent shell each time you jump to a project. Commands run in parent-to-child order (domain hooks first, then group, then project).
[hooks]
on_enter = [
"echo 'Switched to work environment'",
"source ~/.work-aliases",
]Merge rule: append mode -- all levels execute, parent-to-child order.
Type: string
Levels: global, domain, group, project
Text rendered as FIGlet ASCII art when switching to an environment with a different logo_text
value. Set to an empty string to suppress the logo for a specific subtree.
logo_text = "Work"Merge rule: child overrides parent. None (field absent) inherits from parent; an explicit
empty string "" suppresses the logo.
When you jump to a project, gj walks from the domain directory down to the project directory,
loading .git-jump.toml at each level and merging them in order:
domain config -> group config -> subgroup config -> project config
The merge rules for each field type:
| Field | Rule |
|---|---|
env |
Same key: child overrides. Different keys: merged. |
git_config |
Same key: child overrides. Different keys: merged. |
hooks.on_enter |
Append: all levels execute, parent-to-child order. |
web_url_template |
Child overrides parent entirely. |
logo_text |
Child overrides parent. Absent (None) inherits. |
alias |
Not merged. Each project uses its nearest ancestor's alias. |
Given this structure:
git.example.com/.git-jump.toml # alias="work", user.email="team@example.com"
backend/.git-jump.toml # user.email="backend@example.com", GOPATH="/go"
api/.git-jump.toml # on_enter=["make deps"]
Jumping to api produces:
alias:work(from domain, not merged)user.email:backend@example.com(group overrides domain)GOPATH:/go(from group, no conflict)on_enter:["make deps"](only project level defined hooks here)
The alias field creates a short name for a directory, making it usable as a path prefix in
matching, tab completion, and the TUI selector.
With alias = "work" in git.example.com/.git-jump.toml:
git.example.com/backend/api -> work/backend/api
git.example.com/frontend/app -> work/frontend/app
Both the original path and the alias path are valid for matching:
gj work api # matches via alias prefix
gj example api # matches via domain name
gj api # matches by project name aloneAliases can be set at group level too. With alias = "be" in
git.example.com/backend/.git-jump.toml:
git.example.com/backend/api -> work/be/api (domain alias + group alias)
When multiple domains have the same alias, all their projects appear under that alias prefix in the TUI selector. This lets you group projects from different servers under a single short name.
If two projects resolve to the same alias path, gj detects the collision and shows both
candidates in the TUI selector with their full paths for disambiguation.
- Must not be empty
- Must not contain
/(single path segment only) - Must not contain whitespace
The following variables are available in web_url_template:
| Variable | Description | Example value |
|---|---|---|
{domain} |
Git server hostname | github.com |
{groups} |
Group path, /-separated, including subgroups |
my-org/sub |
{project} |
Project (repository) name | backend-api |
{branch} |
Current local Git branch (runs git rev-parse --abbrev-ref HEAD) |
main |
{path} |
Current working directory relative to the git root | src/handlers |
Notes:
{branch}triggers agitsubprocess only when present in the template.{path}is empty when you are at the project root or when using pattern-based browse.- When
{branch}isHEAD(detached HEAD state),gjprints a warning. - Consecutive slashes in the rendered URL are collapsed automatically.
gjclone automatically creates a domain config with the correct template for known hosts:
| Host | Template |
|---|---|
github.com |
https://{domain}/{groups}/{project}/tree/{branch}/{path} |
gitlab.com |
https://{domain}/{groups}/{project}/-/tree/{branch}/{path} |
bitbucket.org |
https://{domain}/{groups}/{project}/src/{branch}/{path} |
| Other | All web_url_template lines commented out -- fill in manually |
Projects that live outside the organized root/domain/group/project structure are called
non-domain projects. gj supports them with reduced functionality:
gj .works: detects the git root and loads config by walking from/to the git root.git-jump browseworks if aweb_url_templateis set in a.git-jump.tomlalong the path.- Pattern-based
gj <pattern>does not discover non-domain projects.
Config scanning for non-domain projects walks every ancestor directory from / to the git root,
loading .git-jump.toml at each level. Permission errors are silently skipped.
~/code/git.example.com/.git-jump.toml:
# Short alias for this domain
alias = "work"
# Browse URL template (GitLab format)
web_url_template = "https://{domain}/{groups}/{project}/-/tree/{branch}/{path}"
# ASCII art logo shown when switching to this environment
logo_text = "Work"
# Git identity applied to all projects under this domain
[git_config]
"user.name" = "Your Name"
"user.email" = "you@company.com"
# Environment variables
[env]
KUBECONFIG = "/home/you/.kube/work-config"
# Hooks run on every jump into this domain
[hooks]
on_enter = ["echo 'Switched to work environment'"]~/code/git.example.com/devops/.git-jump.toml:
# Short alias for this group (stacks with domain alias)
alias = "ops"
# Override browse URL for this group (different path format)
web_url_template = "https://{domain}/{groups}/{project}/browse/{branch}/{path}"
# Additional env vars for devops projects
[env]
TERRAFORM_ENV = "production"
# Hooks appended after domain-level hooks
[hooks]
on_enter = ["source ~/.devops-aliases"]~/code/git.example.com/devops/helm-charts/.git-jump.toml:
# Override git identity for this specific project
[git_config]
"user.email" = "charts-maintainer@example.com"
# Project-specific env
[env]
HELM_NAMESPACE = "production"
# Project-specific hook (runs after domain and group hooks)
[hooks]
on_enter = ["helm repo update"]~/.config/git-jump/config.toml:
root = "~/code"
browser = "firefox --new-tab {url}"
logo_text = "dev"