Skip to content

Instantly share code, notes, and snippets.

@devzom
Last active March 10, 2026 14:18
Show Gist options
  • Select an option

  • Save devzom/dd4db18e2d279728aeb8a684f52f0687 to your computer and use it in GitHub Desktop.

Select an option

Save devzom/dd4db18e2d279728aeb8a684f52f0687 to your computer and use it in GitHub Desktop.
Global .gitconfig to get the best results and DX in every repository
; https://blog.gitbutler.com/how-git-core-devs-configure-git
; https://jvns.ca/blog/2024/02/16/popular-git-config-options/
[user]
name = NameXXX
email = your@email.com
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
amend-quick = commit --amend --no-edit
[init]
defaultBranch = main
[branch]
sort = -committerdate
[push]
default = simple
autoSetupRemote = true
followTags = true
[credential "https://github.com"]
helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper = !/opt/homebrew/bin/gh auth git-credential
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[diff]
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
submodule = log
[submodule]
recurse = true
[pull]
rebase = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
[fetch]
prune = true
pruneTags = true
all = true
[rerere]
enabled = true
autoupdate = true
[core]
editor = true
excludesfile = ~/.gitignore
fsmonitor = true
untrackedCache = true
[help]
autocorrect = prompt
[tag]
sort = version:refname
[commit]
verbose = false
; gpgsign = true
[merge]
conflictstyle = zdiff3
; This setting controls how aggressively Git compresses repository data. A depth of 20 balances storage efficiency against the computational cost of packing and unpacking objects. Lower values mean faster operations but larger repositories; higher values save space but slow down operations slightly.
[pack]
depth = 20
[log]
date = iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment