-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitconfig
395 lines (254 loc) · 9.58 KB
/
.gitconfig
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t
# vi: set shiftwidth=4 tabstop=4 noexpandtab:
# :indentSize=4:tabSize=4:noTabs=false:
#
# resources
# - https://github.com/henrebotha/dotfiles/blob/main/git/dot-gitconfig
[alias]
# Display all aliases :)
aliases = ! git config --list | awk '/alias/{ print $1 }' | perl -pe 's/alias\\.//g' | perl -pe 's/=.+//g'
ap = -c color.diff=true add --patch
authors-current = !git ls-files | xargs -n1 git blame --line-porcelain | sed -n -e 's/^author //p' | sort | uniq -c | sort -rn
authors = shortlog -sne
br = branch
car = commit --amend --no-edit
changed = whatchanged --stat
ci = commit -vv
checkout = checkout --no-guess
co = checkout --no-guess
dc = diff --word-diff-regex=.
dca = diff --cached
dcac = diff --cached --word-diff-regex=.
dcaw = diff --cached --word-diff
df = diff
# full context
dfc = diff --no-prefix -U1000
dfs = ! git diff | grep -v -e ^--- -e ^@@ -e ^+++ -e ^index
dw = diff --word-diff
edit=commit --amend --only
genesis = commit --allow-empty -m Genesis
fa = fetch --all --prune
ff = merge --ff-only
find-deleted-commit = ! git fsck --no-reflog | awk '/dangling commit/ {print $3}' 2>/dev/null
fp = fetch --prune
# http://vstone.eu/github-pull-requests-as-seen-by-git/
fpr = !sh -c \"git fetch ${2:-origin} pull/${1}/head:PR/${2:-origin}/${1}\" -
hidden = ! git ls-files -v . | grep ^S | awk '{ print $2 }'
hide = update-index --skip-worktree
unhide = update-index --no-skip-worktree
unhide-all = ! cd $(git rev-parse --show-toplevel || echo ".") && git hidden | xargs git unhide
igd = ls-files --others -i --exclude-standard
# http://stackoverflow.com/questions/2363197/can-i-get-a-list-of-files-marked-assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]"
ignore = update-index assume-unchanged
unignore = update-index --no-assume-unchanged
# https://ses4j.github.io/2020/04/01/git-alias-recent-branches/
lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}'
# http://tschuermans.be/2016/03/git-compare-log-develop/
# A small git alias which can be used to list all commits which are
# different to the master (or an optionally named) branch.
logcompare = "!f() { git log --oneline --decorate ${1:-master}..$(git rev-parse --abbrev-ref HEAD); }; f"
l = -c color.diff=true log
lg = -c color.diff=true log --oneline --decorate --graph
lga = -c color.diff=true log --oneline --decorate --graph --all
lgb = -c color.diff=true log --oneline --decorate --graph --branches
lo = -c color.diff=true log --oneline --decorate
lol = log --graph --decorate --abbrev-commit --pretty=custom --date=short
lola = log --graph --decorate --abbrev-commit --all --pretty=custom --date=short
lold = log --graph --decorate --abbrev-commit --all --pretty=custom
lolt = log --graph --decorate --abbrev-commit --all --pretty=custom --simplify-by-decoration
ls = ls-files
ls-untracked = ls-files --others
#myinfo = ! echo && git remote -v && echo && git --no-pager branch --color=always --all --list -vv && echo && git st && echo && git log --decorate --abbrev-commit --pretty=custom --date=relative -n 3 && echo
myinfo = ! echo && git remote -v && echo && git --no-pager branch --list --color=auto --all --column=always && echo && git st && echo && git log --decorate --abbrev-commit --pretty=custom --date=relative -n 3 && echo
# https://twitter.com/DotProto/status/991112367323824128
orphan = ! git log --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -d \" \" -f 1`
# Safer alternative to --force
please = push --force-with-lease
pf = push --force-with-lease
# Prune deletes any local branch which has been deleted from the remote.
prune = fetch --prune
pushall = "!git remote -v | grep push | grep -v http | awk '{print $1}' | xargs -I@ bash -xc 'git push --all @ ; git push --tags @'"
rm-deleted = ! git rm $(git ls-files --deleted)
rm-untracked = ! rm -v $(git ls-files --others)
# Print absolute path of repo root directory
root = rev-parse --show-toplevel
sdc = show --word-diff-regex=.
sdw = show --word-diff
show-upstream = rev-parse --abbrev-ref --symbolic-full-name @{u}
st = status --short --branch --verbose --show-stash
stash-all = stash save --include-untracked
# squash last 2 commits, keep oldest commit message
squash2 = !"GIT_EDITOR=\"sed -i '2s/pick/squash/;/# This is the 2nd commit message:/,$ {d}'\" git rebase -i HEAD~2"
# squeeze new stuff into latest commit
squish = !"git status && git commit --amend -C HEAD --date=\"`date`\""
squisha = !"git status && git commit -a --amend -C HEAD --date=\"`date`\""
tags = "!git for-each-ref --sort=taggerdate --format '%(tag)%09%(taggerdate:raw)%09%(*authorname)%09' refs/tags | awk '{print $1\"\t\t\"strftime(\"%F %H:%M\", $2)\"\t\"$4\" \"$5\" \t\t\"$6\" \"$7\" \"$8\" \"$9\" \"$10}' | column -t"
tree = log --all --graph --oneline --simplify-by-decoration --decorate-refs-exclude='refs/tags'
treet = log --all --graph --decorate --oneline --simplify-by-decoration
up = remote update --prune
wip = commit -a -m WIP
[apply]
whitespace = fix
[branch]
autosetupmerge = true
autosetuprebase = always
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
context = white
meta = blue black bold reverse
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
oldMoved = 8
newMoved = 14
oldMovedAlternative = 8 # grey
newMovedAlternative = 14
whitespace = white black reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
added = yellow
changed = green
untracked = cyan
[commit]
gpgsign = false
verbose = true
[core]
autocrlf = false
editor = vim
excludesFile = ~/.gitignore
ignorecase = false
whitespace = trailing-space,space-before-tab
quotepath = false
#pager = diff-so-fancy | less --tabs=4 -RFX
# https://veronneau.org/a-better-git-diff.html
#pager = diff-highlight | less --tabs=4 -RFX
# -X: don't talk to X11 on startup
# -R: read only mode
# -n: don't use a swap file
# -c: run command on start, after autocmd/modeline
#pager = ifne vim -X -R - -n -c 'set filetype=git nowrap noro'
sparseCheckoutCone = 1
[diff]
colorMoved = dimmed-zebra
colorMovedWS = allow-indentation-change
compactionheuristic = true
fallbackToNoIndex = true
mnemonicprefix = true ; replace a/b with (i)ndex/(c)ommit/(w)orking tree
noprefix = true
renames = copy
tool = difftastic
[difftool]
prompt = false
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
#[difftool "icdiff"]
#
# cmd = icdiff --line-numbers $LOCAL $REMOTE
[diff-so-fancy]
first-run = false
changeHunkIndicators = false
[grep]
lineNumber = true
extendedRegexp = true
fallbackToNoIndex = true
[fetch]
prune = false
# https://groups.google.com/forum/m/#!msg/binary-transparency/f-BI4o8HZW0/MDmnWideAgAJ
fsckobjects = false
[format]
signOff = true
[github]
user = srgvg
[gitreview]
username = svg
[gpg]
program = gpg
[init]
templateDir = /home/serge/.git-template
defaultBranch = main
#defaultBranch = main
[merge]
conflictstyle = diff3
[pager]
difftool = true
[pretty]
onefullline = %C(yellow)%h%C(reset) %C(green)%ar%C(reset) %C(bold blue)%an%C(reset) %C(red)%d%C(reset) %s
custom = %C(bold blue)%h%C(reset) %C(bold green)%ad%C(reset) %C(dim white)%an%C(reset) %C(white)%s%C(reset) %C(bold yellow)%d%C(reset)
[pull]
#ff = only
rebase = true
[push]
# git push will by default push all branches that have the same name on the remote
# to limit this behavior to just the current branch, set this configuration option:
default = tracking
#default = matching
# Instead of manually pushing new tags with --follow-tags, you always send
# your local tags up along with a git push.
followTags = true
[rebase]
autoStash = false
updateRefs = true
[receive]
# https://groups.google.com/forum/m/#!msg/binary-transparency/f-BI4o8HZW0/MDmnWideAgAJ
fsckobjects = true
#[sendemail]
#
# smtpserver = smtp.gmail.com
# smtpserverport = 587
# smtpencryption = tls
# smtpuser = [email protected]
# verify = off
[status]
relativePaths = true
showUntrackedFiles = all
submodulesummary = true
showStash = true
[svn]
# push empty directory removals back to svn as directory deletes
rmdir = true
[transfer]
# https://groups.google.com/forum/m/#!msg/binary-transparency/f-BI4o8HZW0/MDmnWideAgAJ
fsckobjects = true
[user]
name = Serge van Ginderachter
email = [email protected]
#signingkey = D08FC082B8E46E8E
signingkey = 8CC387DA097F5468
## includes
[include]
path = ~/.gitconfig.d/git-repo
[includeIf "gitdir:~/src/autops/"]
path = ~/.gitconfig.d/autops
[includeIf "gitdir:~/src/ginsys/"]
path = ~/.gitconfig.d/ginsys
[includeIf "gitdir:~/src/equans/"]
path = ~/.gitconfig.d/equans
[includeIf "gitdir:~/src/mateco/"]
path = ~/.gitconfig.d/mateco
[includeIf "gitdir:~/src/nccn/"]
path = ~/.gitconfig.d/nccn
[advice]
addIgnoredFile = false
[diff "dyff"]
command = "dyff_between() { dyff --color on between --omit-header \"$2\" \"$5\"; }; dyff_between"
[credential "https://github.com"]
helper =
helper = !/home/serge/.asdf/installs/github-cli/2.60.1/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/home/serge/.asdf/installs/github-cli/2.60.1/bin/gh auth git-credential