.dotfiles

Git Configuration

Modern Git setup with SSH signing, delta diffs, and security-first defaults.

Files

Quick Setup

./src/git/install-git-hooks        # Install hooks
./src/git/setup-git-signing        # Configure SSH signing

Key Features

Minimal Aliases (14 git-native)

Defined in gitconfig under [alias] (used as git <alias>):

git s     # status -sb
git l     # log --oneline --graph --decorate -20
git undo  # reset --soft HEAD~1
git amend # commit --amend --no-edit
git wip   # add -A && commit -m 'WIP'

Shell shortcuts (gs, ga, gc, gp, gl, gpl, โ€ฆ) are separate zsh aliases in src/zsh/aliases.zsh.

[gpg]
    format = ssh
[user]
    signingkey = ~/.ssh/id_rsa.pub

10x easier than GPG - no key expiration, already have SSH keys.

Delta Integration

Beautiful side-by-side diffs with syntax highlighting:

[core]
    pager = delta
[delta]
    side-by-side = true
    line-numbers = true

Security Settings

[transfer]
    fsckobjects = true  # Validate all objects
[commit]
    gpgsign = true      # Sign all commits

Lessons Learned

Donโ€™t use GPG unless required - SSH signing simpler, GitHub native.

Keep aliases minimal - Had 50+, nobody remembered them.

Donโ€™t hardcode paths - Hooks check multiple config locations.

Use zdiff3 for merges - Shows common ancestor, clearer than diff3.

Common Issues

Gitleaks blocking commits: False positive? Use Gitleaks default configuration or create .gitleaks.toml in project root.

Delta not working: Install with brew install git-delta.

SSH signing fails: Run ./setup-git-signing to configure.

See GitHub SSH Signing Docs for more details.