-
Notifications
You must be signed in to change notification settings - Fork 0
Git
Git configuration, global ignore rules, commit template, and hook templates.
| Tool | Purpose | Install |
|---|---|---|
| delta | Pager, diff viewer |
winget install dandavison.delta / cargo install git-delta
|
| nvim | Commit editor | see nvim/
|
| pwsh 7+ | PowerShell hook variant | winget install Microsoft.PowerShell |
| File | Installed as | Notes |
|---|---|---|
gitconfig |
~/.gitconfig |
Base config for all machines |
gitconfig-work |
~/.gitconfig-work |
Work overrides; auto-included per-repo via [includeIf]
|
gitignore |
~/.gitignore |
Global ignore rules |
gitmessage |
~/.gitmessage |
Commit message template |
templates/ |
~/.git_templates/ |
Hook templates copied into every new repo |
- Delta as pager and diff filter — side-by-side view, line numbers, syntax highlighting
- Histogram diff algorithm — better diff quality on refactored code
- zdiff3 conflict style — shows common ancestor in conflict markers
-
pull.ff = only— never creates merge commits on pull -
rebase.updateRefs = true— automatic stacked branch ref updates -
rebase.rescheduleFailedExec = true— retry failedexecsteps in interactive rebase -
rerere.enabled = true— remembers and replays conflict resolutions -
push.autoSetupRemote = true— no manual upstream needed on first push -
push.useForceIfIncludes = true— safety check: force push only if remote hasn't diverged unexpectedly -
fetch.fsckObjects+transfer.fsckObjects— integrity check on every fetch/clone -
column.ui = auto— columnizegit branch,git tag, and similar list output -
maintenance.strategy = incremental— background repo maintenance; activate per-repo withgit maintenance register -
GitHub SSH rewrite — both
https://github.com/andgh:resolve to SSH
Work email and diff.tool = delta are applied automatically for any repo whose
remote URL matches the work domain. Requires Git 2.36+.
For local-only work repos without a remote yet:
git config user.email your-work-emailHooks are copied into ~/.git_templates/ and inherited by every new repo via
init.templatedir. Existing repos need git init re-run to pick them up.
A sh dispatcher that delegates to .ps1 (if pwsh is available) or .sh
(POSIX fallback). Both implementations:
- Detect JIRA tickets (
WORD-123) or ADO work items (numeric) from the branch name - Append as a footer trailer — keeps the subject line clean for conventional commits:
or for ADO:
feat(scope): add the thing Refs: PROJ-123feat(scope): add the thing Refs: AB#1234 - Skip merge and squash commits
- Skip configurable branches (default:
main,master,develop,staging,test,deploy/*) - Skip if the trailer is already present (safe to
--amend)
Override the skip list per-repo:
git config hooks.skipBranches "main,release/*,hotfix/*"Auto-regenerate ctags after relevant git operations. Reads ~/.ctags for
tag configuration. Create a .notags file in any repo to disable.
./setup.ps1 -Module git # Windows
./setup.sh -m git # Linux / WSLInstalls ~/.gitconfig and ~/.gitconfig-work as [include] stubs pointing
to the repo files (changes are live immediately, works cross-volume).
Junctions/symlinks ~/.git_templates → git/templates/.
Source: git/README.md in the dotfiles repo.
Getting started
Core (Windows)
Cross-platform
Claude Code & AI
Reference
Legacy (Linux)
Troubleshooting