Skip to content

Git

Global Git configuration symlinked to ~/.gitconfig.

Location

FileSymlinked to
config/git/.gitconfig~/.gitconfig

Key settings

Push & pull

SettingValueDescription
push.defaultsimplePush current branch to its upstream
pull.rebasetrueRebase instead of merge on pull
branch.autosetuprebasealwaysAuto-rebase on new tracking branches

Signing

Commits and tags are signed with an SSH key.

SettingValue
commit.gpgsigntrue
tag.gpgSigntrue
gpg.formatssh
gpg.ssh.allowedSignersFile~/.ssh/allowed_signers
user.signingkey~/.ssh/id_rsa.pub

Credentials & connection

SettingValueDescription
credential.helpercache --timeout=3600Cache credentials for 1 hour
rerere.enabledtrueRemember resolved conflicts
color.uitrueColor terminal output

Defaults

SettingValue
init.defaultBranchmain
status.showUntrackedFilesall
diff.wordRegex.

Machine-specific overrides

Settings that differ per machine (email, signing key, corporate identity, etc.) go in ~/.gitconfig.local, which is not tracked by git.

ini
# ~/.gitconfig.local
[user]
  email = work@company.com
  signingkey = ~/.ssh/work_key.pub

This file is included at the bottom of .gitconfig:

ini
[include]
  path = ~/.gitconfig.local