Git Configuration - uhop/dotfiles GitHub Wiki
| Setting | Value | Purpose |
|---|---|---|
core.pager |
delta |
Syntax-highlighting pager |
core.editor |
micro |
Default editor |
core.autocrlf |
input |
Convert CRLF→LF on commit, keep LF on checkout |
core.whitespace |
trailing-space,-space-before-tab,cr-at-eol |
Whitespace error detection |
interactive.diffFilter |
delta --color-only |
Interactive staging diffs |
init.defaultBranch |
main |
Default branch name |
pull.rebase |
false |
Merge on pull (no rebase) |
push.autoSetupRemote |
true |
Auto-track remote on first push |
remote "origin".prune |
true |
Auto-prune stale remote branches on fetch |
delta — line-based, syntax-highlighted (default)
Delta is wired into core.pager / interactive.diffFilter / pager.diff, so every git diff, git log -p, git show, git add -p etc. flows through it. Defaults:
-
Theme:
Monokai Extended— shared withbatvia~/.config/bat/configsogit diffandcat/batrender syntax identically. Preview alternatives withdelta --list-syntax-themesorbat --list-themes. - Layout: inline (side-by-side off). Laptop-first; wide layout on demand.
-
navigate = true— pressn/Nin the pager to jump between hunks. -
line-numbers = true— gutter with before/after line numbers. -
diff.colorMoved = default— reformats moved-line blocks so they stand out from genuine edits.
The retained legacy [color "diff"] / [color "diff-highlight"] sections feed plain git diff when delta isn't available (failure fallback). Values:
- Old lines: red bold, highlight on color 52
- New lines: green bold, highlight on color 22
- Meta: color 11 · Fragment headers: magenta bold · Function context: color 146 bold · Commit hash: yellow bold
Inline is the default because a 13″ / 14″ laptop panel runs out of columns for side-by-side. The [delta "wide"] named feature flips it on for a single invocation:
git dw # alias: wide `git diff`
git -c delta.features=wide show # ad-hoc wide on any commanddifftastic — structural (AST) diff, on demand
Difftastic parses both sides into syntax trees and diffs the trees, so reformats, moves, and rearrangements show as the small edits they really are. Not wired into git diff — it's registered as a difftool:
git dft # alias: structural diff of unstaged changes
git dft --cached # staged changes
git dft main..HEAD # branch rangediff.tool = difftastic makes git difftool use it by default. Good fit for: big refactors, whitespace-only churn, auto-formatter passes, file moves. Not a pager replacement — line-based delta stays the workhorse.
<hash> <decorations> <subject> (<relative date>) [<committer>]
Used by: ls, ll, lsf, tree
Multi-line format showing commit hash (short + full), decorations, date (absolute + relative), author, subject, and body.
Used by: sl, last
| Alias | Command | Description |
|---|---|---|
git ls |
log --oneline --pretty=better-oneline |
Compact log |
git ll |
log --oneline --pretty=better-oneline --numstat |
Compact log + changed files |
git lsf |
log --oneline --pretty=better-oneline --graph --follow |
Log with graph, follows renames |
git tree |
log --oneline --pretty=better-oneline --all --graph |
Full branch graph |
git sl |
log --graph --pretty=detailed-commit |
Detailed log with graph |
git last |
log -1 --pretty=detailed-commit |
Last commit in detail |
git aliases |
List all configured aliases |
| Alias | Command | Description |
|---|---|---|
git trim |
Delete all local branches except main/master/current, prune origin |
Clean up old branches |
| Alias | Command | Description |
|---|---|---|
git save |
add -A && commit -m 'chore: savepoint' |
Quick save-all commit |
git force-push |
push --force-with-lease |
Safe force push |
git patch |
--no-pager diff --no-color |
Plain-text patch output |
git dw |
-c delta.features=wide diff |
Wide (side-by-side) diff via delta |
git dft |
difftool |
Structural (AST) diff via difftastic |
git precommit |
diff --cached --diff-algorithm=minimal -w |
Review staged changes (ignore whitespace) |
git unmerged |
diff --name-only --diff-filter=U |
List unmerged files |
| Alias | Command | Description |
|---|
| Alias | Description |
|---|---|
git merge-span |
Helper: compute parent range of a merge commit |
git merge-log |
Log of commits in a merge |
git merge-diff |
Diff of a merge |
| Alias | Description |
|---|---|
git authors-list |
Authors sorted by commit count (with emails) |
git authors-count |
Authors sorted by commit count (names only) |
These are standalone scripts available as git <command>:
| Command | Description |
|---|---|
git br |
Pretty branch list: name, subject, relative date, author |
git brr |
Remote branches sorted by committer date |
git bs |
Branch list in columnar format (date, author, branch, subject) |
git mbs |
Filter git bs --all to show only your branches |
git pull-main |
Auto-detect default branch, checkout, and pull |
git super-clean |
Hard reset + deep clean (removes all untracked including ignored) |
See Utilities — Git helpers for details.
Shell aliases (gst, gco, gpush, gsw, etc.) are defined in .bash_aliases and documented in Shell Environment § Git shell aliases. For workflow examples see Workflows: git.
- Font: Hack Nerd Font Mono, size 14
- Hub protocol: SSH
- LFS: Enabled (clean, smudge, filter-process)
The [includeIf] directive loads ~/.gitconfig-work for repositories hosted under a specific GitHub organization. This allows separate name/email for work commits.