Skip to content

Instantly share code, notes, and snippets.

@paralin
Created November 4, 2025 10:37
Show Gist options
  • Select an option

  • Save paralin/c525d29302146c954192e08d11a4212a to your computer and use it in GitHub Desktop.

Select an option

Save paralin/c525d29302146c954192e08d11a4212a to your computer and use it in GitHub Desktop.
best gitconfig options
[user]
# email = [email protected]
# name = Wheatley
[commit]
committerDateIsAuthorDate = true
# gpgsign = 1
[push]
default = simple
[format]
signOff = true
[sendemail]
# smtpServer = ~/go/bin/sendgmailapi
smtpEncryption = tls
smtpServer = smtp.gmail.com
# smtpUser = [email protected]
smtpServerPort = 587
[alias]
find-file = "!for branch in $(git for-each-ref --format=\"%(refname)\" refs/heads); do if git ls-tree -r --name-only $branch | grep \"$1\" > /dev/null; then echo \"${branch}:\"; git ls-tree -r --name-only $branch | nl -bn -w3 | grep \"$1\"; fi; done; :"
large = "!git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort --numeric-sort --key=2 | cut -c 1-12,41- | $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest"
[color]
ui = auto
[github]
user = paralin
[magit]
hideCampaign = true
[url "ssh://[email protected]/myorganization/"]
insteadOf = https://github.com/myorganization/
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[core]
quotepath = false
commitGraph = true
ignorecase = false
excludesfile = ~/.gitignore
[receive]
advertisePushOptions = true
[gc]
writeCommitGraph = true
cruftPacks = true
[credential]
helper = store
[safe]
directory = *
# clearly makes git better
# https://blog.gitbutler.com/how-git-core-devs-configure-git/
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[init]
defaultBranch = master
[diff]
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[push]
default = simple
autoSetupRemote = true
followTags = true
[fetch]
prune = true
pruneTags = true
all = true
[commit]
verbose = true
[rerere]
enabled = true
autoupdate = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
# a matter of taste (uncomment if you dare)
[core]
# fsmonitor = true
# untrackedCache = true
[merge]
# (just 'diff3' if git version < 2.3)
# conflictstyle = zdiff3
[pull]
# rebase = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment