This repository includes a reusable Git configuration focused on a predictable, clean, and efficient daily workflow.
The versioned configuration is stored in:
configs/git/.gitconfig
Personal identity, credentials, signing keys, and account-specific settings must remain in the user's global Git configuration and must not be committed.
The mac setup command configures this automatically and correctly for your installation path.
To configure it manually, set the path to match wherever you cloned this repository:
REPO_DIR="$HOME/path/to/mac-dev-setup"
git config --global include.path "$REPO_DIR/configs/git/.gitconfig"Verify:
git config --global --get include.pathNew repositories use main as their initial branch:
[init]
defaultBranch = mainDeleted remote branches are pruned automatically during fetch operations:
[fetch]
prune = truePull operations use rebase instead of creating an automatic merge commit:
[pull]
rebase = trueLocal changes are temporarily stashed and restored during rebases:
[rebase]
autoStash = trueThe first push of a new branch automatically creates its upstream tracking branch:
[push]
autoSetupRemote = trueGit remembers previous conflict resolutions:
[rerere]
enabled = true
autoupdate = truePreviously recorded resolutions may be reapplied and staged automatically.
Merge conflicts use the zdiff3 style:
[merge]
conflictStyle = zdiff3Branches are sorted by most recent commit date:
[branch]
sort = -committerdateTags are sorted using version-aware ordering:
[tag]
sort = version:refnameLists use columns when appropriate:
[column]
ui = autoGit prompts before applying a suggested correction for a mistyped command:
[help]
autocorrect = promptMoved lines are highlighted more clearly in diffs:
[diff]
colorMoved = zebraInteractive commits display the diff below the commit message editor:
[commit]
verbose = trueGit Delta is configured separately in the same file and provides the default pager and enhanced diff rendering.
Validate the configuration syntax:
git config --file configs/git/.gitconfig --list >/dev/null \
&& echo "Git configuration is valid."Inspect the effective configuration:
git config --global --includes --list --show-originInspect only the workflow-related settings:
git config --global --includes --get-regexp \
'^(init\.|fetch\.|pull\.|rebase\.|push\.|rerere\.|branch\.|tag\.|column\.|help\.|diff\.|commit\.|merge\.|core\.|interactive\.|delta\.)'Remove the include from the global Git configuration (use the same path you set during installation):
REPO_DIR="$HOME/path/to/mac-dev-setup"
git config --global --fixed-value --unset-all include.path \
"$REPO_DIR/configs/git/.gitconfig"Review the global configuration afterward:
git config --global --list --show-originRemoving the include disables the versioned settings without deleting personal identity or credential configuration.
