Repository navigation
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
152 lines (121 loc) · 4.06 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
152 lines (121 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Docs: https://git-scm.com/docs/git-config
# Sections and keys sort alphabetically. Git keeps the last value it reads, so the
# order-dependent blocks (signing, theme, local overrides, personal profile) close the file.
[advice]
detachedHead = false
statusHints = false
[alias]
a = add
b = branch
c = commit
co = checkout
cp = cherry-pick
d = diff
dt = difftool --dir-diff
f = fetch
l = log --oneline --graph --all
m = merge
p = push
r = rebase
s = status
st = stash
u = restore --staged
w = switch
[branch]
sort = -committerdate
[column]
ui = auto
[commit]
verbose = true
[core]
autocrlf = input
# Open nvim only on a terminal so non-interactive agent commits never hang.
editor = "f() { if [ -t 0 ] && [ -t 1 ]; then exec nvim \"$@\"; fi; }; f"
pager = delta --paging=never
[credential "https://gist.github.com"]
helper =
helper = {{ printf "!%s auth git-credential" (joinPath .chezmoi.homeDir ".local/share/mise/shims/gh" | shellQuote) | quote }}
[credential "https://github.com"]
helper =
helper = {{ printf "!%s auth git-credential" (joinPath .chezmoi.homeDir ".local/share/mise/shims/gh" | shellQuote) | quote }}
[delta]
features = side-by-side
line-numbers = true
wrap-max-lines = unlimited
[diff]
algorithm = histogram
colorMoved = zebra
colorMovedWS = allow-indentation-change
mnemonicPrefix = true
tool = nvim
[difftool]
prompt = false
# Open side-by-side directory diffs in Neovim's built-in difftool (TTY only).
[difftool "nvim"]
cmd = {{ printf "LOCAL=\"$LOCAL\" REMOTE=\"$REMOTE\" %s -c \"packadd nvim.difftool\" -c \"lua require('difftool').open(vim.env.LOCAL, vim.env.REMOTE)\"" (joinPath .chezmoi.homeDir ".local/bin/nvim-tty" | shellQuote) | quote }}
[fetch]
all = true
parallel = 0
prune = true
# allowed_signers lists every machine's public key, so any machine verifies signatures locally.
[gpg "ssh"]
allowedSignersFile = {{ joinPath .chezmoi.homeDir ".config/git/allowed_signers" | quote }}
[init]
defaultBranch = main
[interactive]
diffFilter = delta --color-only --paging=never
[merge]
conflictstyle = zdiff3
[pull]
rebase = true
[push]
autoSetupRemote = true
default = current
# Refuse --force-with-lease when the remote tip was never integrated locally.
useForceIfIncludes = true
[rebase]
autoSquash = true
autoStash = true
instructionFormat = "[%an @ %ar] %s"
missingCommitsCheck = warn
updateRefs = true
[rerere]
autoupdate = true
enabled = true
[tag]
sort = version:refname
[transfer]
# Abort transfers when a remote URL embeds credentials.
credentialsInUrl = die
fsckobjects = true
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"
[user]
email = {{ .git_email | quote }}
name = {{ .git_name | quote }}
{{- $signingKey := joinPath .chezmoi.homeDir ".ssh/id_ed25519_signing" }}
{{- if stat $signingKey }}
# Sign commits and annotated tags with this host's passphraseless SSH key when present.
[commit]
gpgSign = true
[gpg]
format = ssh
[tag]
forceSignAnnotated = true
[user]
signingKey = {{ $signingKey | quote }}
{{- end }}
# Theme colors from fmind/theme (loaded after [delta] behavior settings).
[include]
path = {{ joinPath .chezmoi.homeDir ".config/git/theme.gitconfig" | quote }}
path = {{ joinPath .chezmoi.homeDir ".config/git/colors.gitconfig" | quote }}
# Include machine-local configuration and conditional profiles if present.
[include]
path = {{ joinPath .chezmoi.homeDir ".config/git/config.local" | quote }}
# Always use personal email in personal checkouts and this source tree (`~/` resolves symlinks).
{{- $source := printf "%s/" .chezmoi.sourceDir }}
{{- if hasPrefix (printf "%s/" .chezmoi.homeDir) $source }}{{ $source = printf "~/%s" (trimPrefix (printf "%s/" .chezmoi.homeDir) $source) }}{{ end }}
{{- range list $source "~/fmind/" }}
[includeIf {{ printf "gitdir:%s" . | quote }}]
path = {{ joinPath $.chezmoi.homeDir ".config/git/personal.gitconfig" | quote }}
{{- end }}