| title | Git Configuration - Jarvy |
|---|---|
| description | Automate git identity, commit signing, defaults, line endings, credential helpers, and aliases across the team. |
[git] lets jarvy.toml codify Git settings the same way it codifies tools. New developers get a correctly configured Git on first jarvy setup — no more "I forgot to set my email" PRs.
[git]
user_name = "Jane Doe"
user_email = { env = "GIT_EMAIL" }
default_branch = "main"
pull_rebase = trueuser_email = { env = "GIT_EMAIL" } keeps personal email out of the shared config — each developer sets GIT_EMAIL in their shell.
[git]
# Identity
user_name = "Jane Doe"
user_email = { env = "GIT_EMAIL", default = "jane@example.com" }
# Commit signing
signing = true
signing_key = "~/.ssh/id_ed25519.pub"
signing_format = "ssh" # ssh | gpg, auto-detected from key extension
# Defaults
default_branch = "main"
pull_rebase = true
auto_stash = true
push_autosetup = true
editor = "vim"
# Line endings
autocrlf = "input" # true | false | input
eol = "lf"
# Credential helper (auto-detected per OS if omitted)
credential_helper = "osxkeychain"
# Scope
scope = "global" # global (~/.gitconfig) | local (.git/config)
# Aliases
[git.aliases]
co = "checkout"
br = "branch"
ci = "commit"
st = "status"
lg = "log --oneline --graph --decorate"Any string field accepts three forms:
| Form | Example | Behavior |
|---|---|---|
| Plain | user_name = "Jane" |
Used as-is |
| Env-only | user_email = { env = "GIT_EMAIL" } |
Reads env at runtime; errors if unset |
| Env + default | user_email = { env = "GIT_EMAIL", default = "fallback@x.com" } |
Reads env, falls back if unset |
Use the env+default form to keep secrets and personal info out of the shared jarvy.toml.
Commit signing is auto-detected from the key extension:
| Key | Format detected |
|---|---|
~/.ssh/id_ed25519.pub |
ssh |
~/.ssh/id_rsa.pub |
ssh |
| Any other path | gpg |
Override explicitly with signing_format:
signing_format = "gpg"When signing = true, Jarvy sets:
commit.gpgsign = truetag.gpgsign = truegpg.format = ssh|openpgpbased onsigning_formatuser.signingkey = <signing_key>- For SSH: configures
gpg.ssh.allowedSignersFileif present
If credential_helper is omitted, Jarvy picks per OS:
| OS | Default |
|---|---|
| macOS | osxkeychain |
| Linux | cache |
| Windows | manager-core |
Override with any helper name accepted by git config credential.helper.
| Scope | File | Use |
|---|---|---|
global (default) |
~/.gitconfig |
Per-developer settings |
local |
.git/config |
Per-repo settings (e.g. work email for a work repo) |
A common pattern: keep user_name/user_email at scope local for a work repo, leave personal global config alone.
[git.aliases]
co = "checkout"
unstage = "reset HEAD --"
last = "log -1 HEAD"These map directly to git config --<scope> alias.<name> "<value>". Existing aliases are overwritten.
jarvy setup invokes git config --<scope> <key> <value> for each setting. The order:
- Identity (
user.name,user.email) - Signing config (if enabled)
- Defaults (
init.defaultBranch,pull.rebase, etc.) - Line endings (
core.autocrlf,core.eol) - Credential helper
- Aliases
If git itself is missing, the whole [git] section is skipped with a warning — install Git first.
jarvy setup # Applies [git] config
jarvy doctor # Verifies expected values are set
jarvy diff # Shows pending git config changes- Source:
src/git/ - Files:
config.rs,identity.rs,signing.rs,aliases.rs,setup.rs - Key types:
GitConfig,ConfigValue,ConfigScope,SigningFormat,AutoCrlf