Skip to content

Git Configuration Standards

Status: 🟢 Active  |  Owner: Engineering Enablement

Required Global Configuration

# Identity
git config --global user.name "Firstname Lastname"
git config --global user.email "[email protected]"

# Core behaviour
git config --global core.autocrlf false
git config --global core.eol lf
git config --global pull.rebase true
git config --global init.defaultBranch main
git config --global push.default current

# Signed commits (required)
git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub

# Better diff and log
git config --global diff.algorithm histogram
git config --global log.date iso

Required .gitattributes

# .gitattributes — commit to every repository root

# Default — normalise line endings to LF
* text=auto eol=lf

# Explicitly LF
*.sh text eol=lf
*.py text eol=lf
*.java text eol=lf
*.ts text eol=lf
*.go text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.md text eol=lf
*.tf text eol=lf

# Binary — do not diff
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.zip binary
*.jar binary
*.class binary

Required .gitignore (Base)

# IDEs
.idea/
.vscode/
*.iml
*.iws

# OS
.DS_Store
Thumbs.db
*.swp

# Build outputs
target/
build/
dist/
__pycache__/
*.pyc
node_modules/
.next/

# Environment
.env
.env.local
*.env

# Terraform
.terraform/
*.tfstate
*.tfstate.backup

# Secrets — catch-all (Gitleaks is the real enforcement)
*.pem
*.key
*.p12

Last reviewed: 2025-Q4  |  Owner: Engineering Enablement