apply-files concatenates pieces from this repo into a single
~/.gitconfig on every run:
~/.gitconfig = home/.gitconfig-base
+ home/.gitconfig-gui (if a graphical session is detected)
+ home/.gitconfig-nogui (otherwise)
+ [commit]/[tag] gpgsign (if an SSH agent is reachable)
GUI is detected by $DISPLAY / $WAYLAND_DISPLAY on Linux, and is always
true on macOS. There is no [includeIf] magic — the file is rebuilt
deterministically each time you run apply:files. This avoids subtle
"include drift" between machines.
| File | Always applied? | Notes |
|---|---|---|
home/.gitconfig-base |
Yes | User identity, aliases, color, SSH-key signing, SOPS, SSH-over-HTTPS rewrite |
home/.gitconfig-gui |
GUI only | Sublime Merge as mergetool, Sublime Text as editor, delta with --side-by-side |
home/.gitconfig-nogui |
CLI only | Neovim as editor, delta in single-pane mode |
Never copy .gitconfig-gui / .gitconfig-nogui to ~ directly — they're
fragments, not standalone configs (see AGENTS.md).
[user]
name = Jose Peleteiro
email = jose@peleteiro.net
[github]
user = peleteirogit lg # decorated, single-line graph log with relative dates
git w # alias for whatchangedEverything color-on (diff, status, branch, interactive, ui, pager). Custom
palette per section in [color "branch"], [color "diff"], [color "status"].
[gpg]
format = ssh
[user]
signingkey = key::ssh-ed25519 AAAA...commit.gpgsign / tag.gpgsign are appended conditionally by
apply-files only when an SSH agent is reachable — see
secrets.md for the full story.
[url "git@github.com:"]
insteadOf = https://github.com/Any git clone https://github.com/<...> is silently rewritten to
git@github.com:<...>. Avoids accidental token prompts and keeps everything
flowing through the 1Password SSH agent.
[branch]
autosetuprebase = always # `git pull` rebases by default on new branches
defaultBranch = main
[init]
defaultBranch = main
[push]
default = matching # push branches with matching names on the remote[core]
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eolgit apply --whitespace=fix (and git diff --check) flags trailing spaces,
CR-at-EOL, but tolerates indent-with-non-tab (handy in mixed-language repos).
[diff "sops"]
textconv = sops -dCombined with a .gitattributes entry *.enc.yaml diff=sops, lets git diff
on encrypted files show the plaintext diff.
- Editor:
subl -n -w(Sublime Text opens a new window, waits) - Mergetool:
smerge(Sublime Merge),prompt = false - Diff tool:
smerge,prompt = false - Pager:
deltawith--side-by-side --line-numbers, navigate-on
- Editor:
nvim - Pager:
deltawith--line-numbers, navigate-on (no side-by-side — too cramped in single-column terminals) - No mergetool / difftool — resolve conflicts manually in Neovim
Both rely on delta for diff
rendering. Delta picks colors that match the rest of the Catppuccin Mocha
palette through 256-color ANSI defaults.
# Status with the global hooks dir disabled (debug)
git -c core.hooksPath=/dev/null status
# Sign-status of recent commits
git log --show-signature -n 5
# (only verifies your own signatures if you set up gpg.ssh.allowedSignersFile —
# see secrets.md)
# Pull with rebase (already the default on new branches)
git pull --rebase
# Clone over SSH even when you pasted an HTTPS URL — handled automatically
# by the [url] rewrite in the base config
git clone https://github.com/foo/bar # → actually clones git@github.com:foo/barThe project's own AGENTS.md spells out the conventions for AI agents and contributors. Key reminders for git:
- Always create a NEW commit rather than amending — pre-commit hook failures should be fixed with a follow-up commit, not by editing the previous one.
- Don't use
--no-verifyunless explicitly requested. - Don't
git add -A/git add .— list paths explicitly to avoid staging stray secrets.
See AGENTS.md for the rest.