Git configuration template with Delta pager support and useful aliases.
- Delta Pager: Syntax-highlighted diffs with line numbers (graceful fallback if not installed)
- Sensible Defaults: Rebase on pull, auto-setup remote, prune on fetch
- Useful Aliases: Short commands for common operations
- No Personal Data: Template does NOT include user.name/email
- Rerere: Remember conflict resolutions for automatic reuse
The dotfiles installer will set this up:
./install.shOr manually:
cp ~/dotfiles/git/gitconfig.template ~/.gitconfig
# Set your personal info (required!)
git config --global user.name "Your Name"
git config --global user.email "your@email.com"Delta provides beautiful syntax-highlighted diffs.
# Cargo (Rust)
cargo install git-delta
# Homebrew (macOS/Linux)
brew install git-delta
# Ubuntu/Debian (download .deb from releases)
# https://github.com/dandavison/delta/releases
# Arch Linux
sudo pacman -S git-deltaThe git config will automatically use delta if installed, or fall back to less.
- Syntax highlighting for 200+ languages
- Line numbers
- Word-level diff highlighting
- Navigate between diff sections with
n/N
| Alias | Command | Description |
|---|---|---|
s |
status -sb |
Short status |
lg |
log --oneline -20 |
Compact log |
lga |
log --oneline --all --graph |
Graph log |
ll |
log --pretty=format:... |
Detailed log |
last |
log -1 HEAD --stat |
Last commit |
today |
log --since=midnight... |
Today's commits |
| Alias | Command | Description |
|---|---|---|
b |
branch -vv |
Branches with tracking |
ba |
branch -avv |
All branches |
bd |
branch -d |
Delete branch |
bD |
branch -D |
Force delete branch |
| Alias | Command | Description |
|---|---|---|
c |
commit |
Commit |
cm |
commit -m |
Commit with message |
ca |
commit --amend |
Amend commit |
can |
commit --amend --no-edit |
Amend without editing |
oops |
add -A && commit --amend --no-edit |
Add all and amend |
| Alias | Command | Description |
|---|---|---|
d |
diff |
Show diff |
ds |
diff --staged |
Staged diff |
dc |
diff --cached |
Cached diff |
| Alias | Command | Description |
|---|---|---|
f |
fetch --all --prune |
Fetch all |
pl |
pull |
Pull |
ps |
push |
Push |
pf |
push --force-with-lease |
Safe force push |
| Alias | Command | Description |
|---|---|---|
unstage |
reset HEAD -- |
Unstage files |
undo |
reset --soft HEAD~1 |
Undo last commit |
cleanup |
(script) | Delete merged branches |
contributors |
shortlog -sn --all |
List contributors |
git config --global core.pager "less -R"git config --global delta.side-by-side trueNote: Requires a wide terminal (100+ columns recommended).
# List available themes
delta --list-syntax-themes
# Set theme
git config --global delta.syntax-theme "Nord"git config --global pull.rebase false- Check if delta is installed:
delta --version - Verify git config:
git config --global core.pager - Test directly:
git diff | delta
If git add -p shows errors, ensure the interactive diffFilter uses --color-only:
git config --global interactive.diffFilter "delta --color-only"Ensure your terminal supports 24-bit color:
echo $COLORTERM # Should be 'truecolor' or '24bit'Or force true color in git config:
git config --global delta.true-color always