Git configuration for this dotfiles setup, providing aliases, tools integration, and security settings.
~/.gitconfig # Main configuration (symlinked)
~/.config/git/ignore # Global ignore patterns
~/.gitmessage # Commit message template
Identifies you as the author of commits.
Fields:
name- Your full name displayed in commitsemail- Email address for commit attributionsigningKey- GPG key fingerprint for commit signing
Example:
[user]
name = Your Name
email = your.email@example.com
signingKey = E8404D8E8DAB59CD1E5255BD56BCDEBC6448A091Core Git behavior settings.
Fields:
Type: true | false | input
Default: false
Current: input
Controls line ending conversion. input converts CRLF to LF on commit but not on checkout (recommended for macOS/Linux).
Type: true | false | warn
Default: false
Current: true
Prevents commits with mixed line endings when enabled.
Type: string
Current: code --new-window --wait
Default editor for commit messages and interactive operations.
Type: path
Current: ~/.gitignore_global
Path to global gitignore file.
Type: string
Current: bat
Program used to page through output (logs, diffs, etc.).
Custom shortcuts for Git commands.
Available Aliases:
| Alias | Expands To | Description |
|---|---|---|
co |
checkout |
Switch branches or restore files |
ci |
commit |
Record changes to repository |
st |
status |
Show working tree status |
br |
branch |
List, create, or delete branches |
hist |
log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short |
Graphical history view |
type |
cat-file -t |
Show object type |
dump |
cat-file -p |
Show object content |
Diff viewing configuration.
Fields:
tool- External diff tool (code)
VSCode Difftool Config:
[difftool "code"]
cmd = code --wait --new-window --diff $LOCAL $REMOTEMerge conflict resolution settings.
Fields:
tool- External merge tool (code)
VSCode Mergetool Config:
[mergetool "code"]
cmd = code --wait --new-window --merge $REMOTE $LOCAL $BASE $MERGEDPush behavior configuration.
Fields:
default- Push strategytracking- Push to upstream branchcurrent- Push current branchsimple- Default in Git 2.0+
Pull behavior settings.
Fields:
rebase- Rebase instead of mergetrue- Always rebasefalse- Always mergeinteractive- Interactive rebase
Content filters for large files and media.
LFS Filter:
[filter "lfs"]
smudge = git-lfs smudge -- %f
required = true
clean = git-lfs clean -- %f
process = git-lfs filter-processOutput colorization settings.
Fields:
ui- Enable colorsauto- Color when outputting to terminalalways- Always use colorsnever- Never use colors
Branch behavior configuration.
Fields:
autosetupmerge- Auto-track remote branchestrue- Set up trackingfalse- No automatic trackingalways- Always set up tracking
Reuse recorded resolution for merge conflicts.
Fields:
enabled- Enable rereretrue- Record and reuse resolutionsfalse- Disabled
Commit behavior settings.
Fields:
gpgsign- Sign commits with GPGtrue- Always signfalse- Don't sign
template- Path to commit message template
GPG signing configuration.
Fields:
format- Signature format (openpgporx509)
Located at ~/.config/git/ignore:
# macOS
*.DS_Store
.AppleDouble
.LSOverride
Icon
._*
# Thumbnails
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories on AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Claude local settings
**/.claude/settings.local.json
# Zsh compiled files
*.zwc
*.zwc.*# Check current configuration
git config --list
# Get specific setting
git config user.name
# Set configuration value
git config --global core.editor "vim"# Instead of: git checkout feature-branch
git co feature-branch
# Instead of: git status
git st
# View pretty history
git hist# Open diff in VSCode
git difftool HEAD~1
# Resolve merge conflicts in VSCode
git mergetoolGit respects these environment variables:
| Variable | Purpose | Example |
|---|---|---|
GIT_EDITOR |
Override core.editor | export GIT_EDITOR=vim |
GIT_PAGER |
Override core.pager | export GIT_PAGER=less |
GIT_AUTHOR_NAME |
Override user.name | export GIT_AUTHOR_NAME="Bot" |
GIT_AUTHOR_EMAIL |
Override user.email | export GIT_AUTHOR_EMAIL="bot@example.com" |
- GPG Signing: Commits are signed with the configured GPG key
- Credentials: Stored in system keychain via credential helpers
- Tokens: GitHub tokens stored in macOS keychain (see
[ghi]section) - SSH: Prefer SSH URLs over HTTPS for better security