Enhance git config with good defaults

See: https://blog.gitbutler.com/how-git-core-devs-configure-git/
This commit is contained in:
Loic Nageleisen 2025-03-26 13:42:23 +01:00
parent 1c49ca503a
commit 9660d1bee0
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2

View file

@ -1,5 +1,7 @@
[push] [push]
default = simple default = simple
autoSetupRemote = true
followTags = true
[include] [include]
path = ~/.gitconfig.lloeki path = ~/.gitconfig.lloeki
[includeIf "gitdir:~/Source/github.com/sqreen/"] [includeIf "gitdir:~/Source/github.com/sqreen/"]
@ -12,8 +14,11 @@
path = ~/.gitconfig.datadog path = ~/.gitconfig.datadog
[core] [core]
excludesfile = ~/.gitignore excludesfile = ~/.gitignore
fsmonitor = true
untrackedCache = true
[pull] [pull]
ff = only ff = only
rebase = true
[url "git@github.com:"] [url "git@github.com:"]
pushInsteadOf = https://github.com/ pushInsteadOf = https://github.com/
insteadOf = https://github.com/ insteadOf = https://github.com/
@ -23,6 +28,10 @@
insteadOf = https://gitlab.adhoc-gti.com/ insteadOf = https://gitlab.adhoc-gti.com/
[diff] [diff]
indentHeuristic = on indentHeuristic = on
algorithm = histogram
colorMoved = plain
mnemonicPrefix = true
renames = true
[alias] [alias]
co = checkout co = checkout
cm = !git add -A && git commit cm = !git add -A && git commit
@ -47,3 +56,24 @@
fetch-pr = !git fetch origin pull/${1}/head:pr/${1} fetch-pr = !git fetch origin pull/${1}/head:pr/${1}
[init] [init]
defaultBranch = main defaultBranch = main
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[fetch]
prune = true
pruneTags = true
all = true
[commit]
verbose = true
[rerere]
enabled = true
autoupdate = true
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
[merge]
conflictstyle = zdiff3