-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
207 lines (175 loc) · 4.91 KB
/
dot_gitconfig.tmpl
File metadata and controls
207 lines (175 loc) · 4.91 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
{{- $diffTool := "" -}}
{{- $mergeTool := "" -}}
{{- $editTool := "" -}}
{{- $pagerTool := index . "gitPagerLocation" -}}
[user]
name = {{ index . "gitUserName" }}
email = {{ index . "gitUserEmail" }}
useConfigOnly = true
[init]
defaultBranch = main
{{- if stat (joinPath .chezmoi.homeDir ".config/git/template") }}
templateDir = ~/.config/git/template
{{- end }}
[core]
autocrlf = input
{{- if eq .chezmoi.os "windows" }}
{{- if stat (index . "notepadppLocation") }}
editor = {{ index . "notepadppLocation" }}
{{- else if stat (index . "gvimLocation") }}
editor = {{ index . "gvimLocation" }}
{{- else if stat (index . "vscodeLocation") }}
editor = {{ index . "vscodeLocation" }} --wait
{{- else if stat (index . "intellijLocation") }}
editor = {{ index . "intellijLocation" }}
{{- else if stat (index . "notepadLocation") }}
editor = {{ index . "notepadLocation" }}
{{- else }}
editor = notepad
{{- end }}
{{- else if ne $editTool "" }}
editor = {{ $editTool }}
{{- end }}
excludesfile = {{ .chezmoi.homeDir }}/.config/git/ignore
longpaths = true
# quotepath = false # Unicode characters
{{- if ne $pagerTool "" }}
pager = {{ $pagerTool }}
{{- end }}
[rerere]
enabled = 1
[credential "https://github.com"]
useHttpPath = true
{{ if ne (index . "ghLocation") "" }}
helper =
helper = !{{ index . "ghLocation" }} auth git-credential
{{ end }}
[credential "https://gist.github.com"]
{{ if ne (index . "ghLocation") "" }}
helper =
helper = !{{ index . "ghLocation" }} auth git-credential
{{ end }}
[credential]
{{ if ne (index . "gitCredentialOAuthLocation") "" }}
{{ if ne (index . "gitCredentialLibSecretLocation") "" }}
helper = {{ index . "gitCredentialLibSecretLocation" }}
{{ else }}
helper = cache --timeout 5184000 # 60 days
{{ end }}
{{ if index . "headless" }}
helper = oauth -device
{{ else }}
helper = oauth
{{ end }}
{{ else if ne (index . "gitCredentialManagerLocation") "" }}
credentialStore = cache
cacheOptions = "--timeout 5184000"
helper = {{ index $ "gitCredentialManagerLocation" }}
{{ else }}
helper = manager
{{ end }}
[credential "https://dev.azure.com"]
useHttpPath = true
[credential "https://git.assembla.com"]
useHttpPath = true
{{ if eq .chezmoi.os "windows" }}
[gpg]
program = "{{ index . "gpgLocation" }}"
{{ end }}
[credential "https://source.developers.google.com"]
provider = generic
[credential "https://gitlab.arran.net.au"]
gitLabAuthModes = pat
# oauthClientId = {{/* (ejsonDecrypt "private_gitlab_oauth.ejson").gitlab_oauth_client_id */}}
{{ if ne .chezmoi.os "windows" }}
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[color "branch"]
current = green
remote = yellow
{{ end }}
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
# Should probably use a script to select here.
{{- if eq $mergeTool "delta" }}
conflictstyle = zdiff3
{{- else if ne $mergeTool "" }}
conflictstyle = diff3 # show original content before conflicts
{{- end }}
{{- if ne $mergeTool "" }}
tool = {{ $mergeTool }}
{{- end }}
[mergetool "kdiff3"]
trustExitCode = false
{{ if ne (index . "sourceTreeLocation") "" }}
[mergetool "sourcetree"]
cmd = {{ index . "sourceTreeLocation" }} \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
{{end}}
[diff]
{{- if ne $diffTool "" }}
tool = {{ $diffTool }}
{{- end }}
colorMoved = default
[difftool]
prompt = true
[difftool "kdiff3"]
trustExitCode = false
{{ if ne (index . "openDiffLocation") "" }}
[difftool "sourcetree"]
cmd = {{ index . "openDiffLocation" }} \"$LOCAL\" \"$REMOTE\"
path =
{{end}}
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[commit]
{{ if index . "gpgconfigured" }}
gpgsign = true
{{ end }}
{{- if stat (joinPath .chezmoi.homeDir ".config/git/message") }}
template = ~/.config/git/message
{{- end }}
status = true
[tag]
{{ if index . "gpgconfigured" }}
gpgsign = true
{{ end }}
{{- if stat (joinPath .chezmoi.homeDir ".config/git/tagmessage") }}
template = ~/.config/git/tagmessage
{{- end }}
[push]
{{ if index . "gpgconfigured" }}
gpgsign = if-asked
{{ end }}
followTags = true
[alias]
#via http://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'
{{- if stat (joinPath .chezmoi.homeDir ".gitconfig.local") }}
[include]
path = ~/.gitconfig.local # Allow for local overrides
{{- end }}
[grep]
lineNumber = true
patternType = extended
[man]
viewer = less
[delta]
navigate = true
[interactive "delta"]
diffFilter = delta --color-only
[http]
cookiefile = ~/.cache/git/cookies
[status]
submodulesummary = true
[advice]
statusHints = false