-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_gitconfig.tmpl
273 lines (226 loc) · 6.37 KB
/
dot_gitconfig.tmpl
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
[user]
name = Erik Kerber
email = ekerber@slack-corp.com
signingkey = 0157E07BE965B5B6
[github]
user = erikkerber
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
editor = nvim
whitespace = trailing-space,space-before-tab
pager = delta
ignorecase = true
# sshCommand = ssh -vvv 2>> ~/ssherrlog >> ~/sshlog
[hub]
protocol = https
host = git.target.com
[init]
templatedir = ~/.git_template
defaultBranch = main
[help]
autocorrect = 10
[push]
default = current
autoSetupRemote = true
[fetch]
prune = true
[branch]
autosetupmerge = true
sort = -committerdate
[branch "main"]
pushRemote = AREYOUSURE
[branch "master"]
pushRemote = AREYOUSURE
[blame]
date = short
coloring = highlightRecent
[delta]
navigate = true
light = false
line-numbers = true
hyperlinks = true
hyperlinks-file-link-format = "vscode://file/{path}:{line}"
[diff]
tool = Kaleidoscope
renames = copies
mnemonicprefix = true
algorithm = patience
indentHeuristic = true
colorMoved = default
noprefix = true
submodule = log
[diff "swift"]
xfuncname = "^ *(\\w+ +)*((class|struct|enum|protocol|extension|func) +|(de)?init\\b).*$"
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path "$MERGED" -- "$LOCAL" "$REMOTE"
[difftool "idiff"]
cmd = "diff -Nuri -U3 --minimal \"$LOCAL\" \"$REMOTE\" | sed 's/^-/\\x1b[1;31m-/;s/^+/\\x1b[1;32m+/;s/^@/\\x1b[1;34m@/;s/$/\\x1b[0m/' | diff-highlight"
[mergetool "vim"]
cmd = vim -c "normal\\ gg]c" -f "$MERGED"
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" --snapshot "$REMOTE" --snapshot
[mergetool]
prompt = false
keepBackup = false
trustExitCode = true
[merge]
tool = Kaleidoscope
keepBackup = false
log = true
stat = true
conflictstyle = zdiff3
[rerere]
enabled = true
autoUpdate = true
[rebase]
autosquash = true
autostash = true
stat = true
updateRefs = true
[stash]
showPatch = true
[gpg]
program = gpg
[commit]
verbose = true
gpgsign = true
[submodule]
fetchJobs = 8
recurse = true
[interactive]
diffFilter = delta --color-only
[diff "plist"]
textconv = plutil -convert xml1 -o -
[diff "provision"]
textconv = security cms -D -i
[diff "exif"]
textconv = exiftool
[difftool "ksdiff"]
cmd = ksdiff --partial-changeset --relative-path "$MERGED" -- "$LOCAL" "$REMOTE"
[format]
pretty = erik
[mergetool "ksdiff"]
cmd = ksdiff --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" "$REMOTE"
[status]
showUntrackedFiles = all
showStash = true
submoduleSummary = true
[sendemail]
smtpEncryption = tls
smtpServer = /usr/local/bin/msmtp
smtpServerOption = -afastmail
[log]
follow = true
[pretty]
erik = %C(blue)%h%Creset %C(green)%ar%Creset %C(magenta)%an%Creset %s%C(cyan)%d%Creset
[grep]
column = true
lineNumber = true
[advice]
waitingForEditor = false
skippedCherryPicks = false
[pager]
branch = false
[pull]
rebase = true
[credential]
{{- if eq .chezmoi.os "darwin" }}
helper = osxkeychain
{{- else }}
helper = /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
{{- end }}
[color]
ui = true
[color "diff-highlight"]
oldNormal = red
oldHighlight = red ul
newNormal = green
newHighlight = green ul
[color "diff"]
meta = yellow
frag = magenta
commit = yellow
old = red
new = green
whitespace = red reverse
[alias]
g = !exec git
git = !exec git
# add
a = add
ap = add --patch
chunkyadd = add --patch
# Be Good
praise = blame
# branch
b = branch -v
ba = branch -a
cb = !sh -c 'git checkout --quiet -b $1 && (git push origin $1 --quiet 2> /dev/null && git branch -u origin/$1 $1 --quiet) &' -
branch = branch -vv
branches = for-each-ref --sort=-committerdate --format="%(color:blue)%(authordate:relative)\t%(color:red)%(authorname)\t%(color:white)%(color:bold)%(refname:short)" refs/remotes
fixmain = git co -b main upstream/main
cleanupb = !sh -c 'git branch -vv >/tmp/merged-branches && vim /tmp/merged-branches && cat /tmp/merged-branches | awk ''{print $1}'' | xargs git branch -D'
# checkout
co = checkout
s = switch
cop = !sh -c 'git branch | cut -c 3- | fzy --query=$1 | xargs git checkout' -
copr = !sh -c 'git branch -r | cut -c 3- | grep -v HEAD | cut -d "/" -f 2 | fzy --query=$1 | xargs git checkout' -
co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
# cherry-pick
cp = cherry-pick
cpn = cherry-pick --no-commit
# commit
c = commit --verbose -m
ca = commit --verbose -am
amend = commit --verbose --amend
amendne = commit --verbose --amend --no-edit
ane = amendne
comf = commit --verbose --fixup=HEAD
# diff
d = diff # diff unstaged changes
dc = diff --cached # diff staged changes
last = diff HEAD^ # diff last committed change
dt = difftool
dtc = difftool --cached
dtk = difftool --tool=Kaleidoscope
dtck = difftool --cached --tool=Kaleidoscope
# rebase
ra = rebase --abort
rc = rebase --continue
rs = rebase --skip
ro = rebase -i origin/main
# reflog
rl = reflog -20
# remote
r = remote -v
f = fetch
ps = push
punch = push --force-with-lease
# Prints the refs only on the remote, suitable for scripting tag cleanup
remote-tags = "!f() { git ls-remote --refs -t $1 | awk ''{print $2}''; }; f"
# reset
nuke = reset --hard HEAD
undo = reset --soft HEAD^
unstage = reset HEAD
uncommit = reset --soft HEAD
cleann = clean -f -d
# merge
mt = mergetool
# stash
ss = stash
sc = stash --cached
sl = stash list
sa = stash apply
sd = stash drop
# via http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
snapshots = !git stash list --grep snapshot
# status
s = status -sb
# log
l = log -20 --topo-order --pretty='format:%Cblue%h%Creset %s%Cred%d%Creset %C(yellow)(%an)%Creset'
logshort = log --pretty=format:"%C(blue)%