-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
667 lines (557 loc) · 23.7 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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# It is easy to shoot your foot off with git, but also easy to revert to a
# previous foot and merge it with your current leg. - Jack William Bell
[hub]
protocol = https
[credential]
# Should maybe just remove and rely on shipped gitconfig, since that should be
# appropriate for the system?
helper = osxkeychain
[core]
# Use custom `.gitignore`
excludesfile = ~/.global-gitignore
# Global gitattributes
attributesfile = ~/.global-gitattributes
# editor and pager set in include file
# Treat spaces before tabs, lines that are indented with 8 or more spaces,
# and all kinds of trailing whitespace as an error
# [default] trailing-space: look for spaces at the end of a line
# [default] space-before-tab: look for spaces before tabs at beginning of line
whitespace = space-before-tab,indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X 10.7+ with autosave/versions
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
# Use 12 characters for the abbreviated commit hash. See:
# http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/
# Via: http://git.io/QXnAqw
# abbrev = 12
[commit]
verbose = true
gpgSign = true
# gpg.program set in include
[alias]
# HEAVILY relied upon
#
# With git 2.28, init can set a defaultBranch different than `master`, and a lot
# of projects are now using main. That's good. It's a pain for git aliases,
# though, since git (unlike, say, bash), can't really "store" information, so
# there's no way to set ahead of time what the current repo's main branch is.
# As such, any alias that wants to, say, show commits between the main branch
# and HEAD can't assume `git log master..HEAD` or `git log main..HEAD` will
# work. Instead, we have to use a function that will figure out the default
# branch and then supply that to other aliases. This is a pain since a simple
# `lm = log main..HEAD` has to instead become `lm = "!git log $(git
# default-branch)..HEAD"` but here we are.
#
# The concept of a default branch doesn't really make sense in the lofty sense
# of git (reasonably good (if under-appreciated) comment here gets into it a
# bit: https://stackoverflow.com/a/65710958/2521092) but in practice, we all
# know what that means. It's possible to figure it out by parsing remotes with
# `git show remote` (https://stackoverflow.com/a/50056710/2521092) or `git
# symbolic-ref refs/remotes/origin/HEAD`
# (https://stackoverflow.com/a/44750379/2521092) but those rely on there *being*
# a remote, and that there is a reliable, consistent naming scheme to those
# remotes. In practice, both are likely, but neither is reliable; moreover,
# they don't fail nicely.
#
# Thus, this is used (via https://stackoverflow.com/a/65859728/2521092): it's
# (probably) faster, doesn't rely on remotes, and can have several backup
# options. It uses the inverse of the default, descending refname, to enable
# "dev" as a third option when main or master are not found. This is only
# possible since we're using the -m1 option for grep.
default-branch = "!git branch --sort=-refname | grep -o -m1 '\\b\\(main\\|master\\|dev\\)\\b'"
h = help
which = help # bash hangover
hc = help config
cfg = config
cfgg = config --get
# List all aliases
aliases = "!git config -l | grep alias | cut -c 7-"
# All options
configs = config -l
notifications = "!browser https://github.com/notifications"
allpulls = "!browser https://github.com/pulls"
allissues = "!browser https://github.com/issues"
init-commit = "!git init && git commit --allow-empty -m 'Initial commit'"
c = commit
cm = commit -m
amend = commit --amend
commend = commit --amend --no-edit
sign = commit --amend --no-edit --signoff
# These two not quite sensible, but roughly mirror the aca/acc behavior below
ca = commit --amend
cc = commit --amend --no-edit
amend-resetauthor = commit --amend --reset-author
commend-resetauthor = commit --amend --no-edit --reset-author
amr = commit --amend --reset-author
cor = commit --amend --no-edit --reset-author
a = add
aa = add -A
all = add -A
# Don't do anything unless there are any staged changes
# More specific (staged) than diff-index
as = "!git add -A; git diff --staged --name-only --quiet || git status --short --branch"
aas = "!git add -A; git diff --staged --name-only --quiet || git status --short --branch"
acm = "!git add -A; git diff --staged --name-only --quiet || git commit -m"
aca = "!git add -A; git diff --staged --name-only --quiet || git commit --amend"
acc = "!git add -A; git diff --staged --name-only --quiet || git commit --amend --no-edit"
ap = add -p
ai = add -p
# Add files via fzf. Would be nice to have a side-style/si option for delta,
# but getting the preview window to adjust it's width isn't possible? The issue
# actually lies with delta, something with width? FIXME TODO
fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 --preview 'git diff --color=always -- {1}' --preview-window 'down,border-top,75%' | xargs -0 git add"
# Create and/or go to a branch. Potentially overridden in local-config to use
# switch -c after 2.23; toolforge annoyingly is still on 2.20.1
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Intentionally missing -b to avoid erroneous checkouts of wrong default branch
co = checkout
com = "!git checkout $(git default-branch)"
cog = checkout gh-pages
cod = checkout dev
gom = "!git checkout $(git default-branch)"
gog = checkout gh-pages
god = checkout dev
wc = whatchanged
s = status --short --branch
sn = status --untracked=no
# stash
st = stash
# Completion treats these as "stash" so won't complete with the list, which sucks
stp = stash pop
pop = stash pop
sta = stash apply
stu = stash push
stup = stash push -p # Or just stash -p
stum = stash push -m
stump = stash push -pm
stus = stash push -s # Only as of git 2.35
stums = stash push -sm
stud = "!git stash push -m \"$(date)\""
stash-backup = "!git stash push -m \"$(date)\" && git stash apply \"stash@{0}\""
stud-backup = stash-backup
std = stash drop
drop = stash drop
stl = stash list
sts = stash show
stb = stash branch
# Various log shorthands and improvements, some accessed via .bashrc aliases
# that (mostly) align with these
l = log --oneline
l5 = l -5
l1 = log -1
logstat = l --stat
lstat = logstat
full = log --pretty=fuller --notes
lf1 = log --pretty=fuller --notes -1
# All commits, and all important/labeled commits. The formatting here just to
# mimic what it gives by default
la = l --graph --decorate --all --pretty=format:"%C(blue)%h%C(auto)%d\\ %s"
las = l --graph --decorate --all --simplify-by-decoration --pretty=format:"%C(blue)%h%C(auto)%d\\ %s"
ld = log --pretty=format:"%C(blue)%h\\ %C(reset)%C(dim)%C(italic)%ad%C(auto)%d\\ %s%C(dim)%C(magenta)\\ [%an]" --decorate --date=short
ld5 = ld -5
ldm = "!git ld $(git default-branch)..HEAD"
lmd = ldm
ldm5 = "!git ld5 $(git default-branch)..HEAD"
ld5m = ldm5
# Potentially overridden in local-config to use date=human after 2.21, see also recent-branches-by-commit and [log]
# Double quotes require escaping the spaces?
lr = log --pretty=format:"%C(blue)%h\\ %C(reset)%C(dim)%C(italic)%ad%C(auto)%d\\ %s%C(dim)%C(magenta)\\ [%an]" --decorate --date=relative
lg = log --color --graph --pretty=format:"%C(blue)%h%C(auto)%d%C(reset)\\ %s\\ %C(dim)%C(italic)(A:\\ %cr,\\ C:\\ %ar)%C(dim)%C(magenta)\\ [%an]" --abbrev-commit --date=relative
lr5 = lr -5
lrm = "!git lr $(git default-branch)..HEAD"
lmr = lrm
lrm5 = "!git lr5 $(git default-branch)..HEAD"
lr5m = lrm5
# Show date a file was added
when-added = log --pretty=format:"%ad" --date=short --diff-filter=A
graph = lg
lm = "!git l --decorate $(git default-branch)..HEAD"
llm = "!git log --notes --decorate $(git default-branch)..HEAD"
loh = l --decorate origin/HEAD..HEAD
lloh = log --notes --decorate origin/HEAD..HEAD
luh = l --decorate @{upstream}..HEAD
lluh = log --notes --decorate @{upstream}..HEAD
# Probably not that useful, but technically possible...
lho = l --decorate HEAD..origin/HEAD
llho = log --notes --decorate HEAD..origin/HEAD
lhu = l --decorate HEAD..@{upstream}
llhu = log --notes --decorate HEAD..@{upstream}
# Relies on split-from alias, log of commits since splitting this branch
ls = "!git l $(git split-from)..head"
lls = "!git log $(git split-from)..head"
# Show new commits, most useful if done right after a pull or fetch
# --name-status to show files and status change (could do --stat too)
# https://git.wiki.kernel.org/index.php/Aliases
# Should probably use $@ in more places to allow subsequent flags to pass
# @ == HEAD, but head is complicated
# Can prefix with a ref (main, dev, etc.), otherwise assumes current branch
# @{1} is the previous value of the ref (eg. prior to an amend), which is
# *almost* the same as ORIG_HEAD, which is the previous value of head before a
# drastic/risky operation (man gitrevisions and https://stackoverflow.com/a/967611/2521092)
# @{0} is thus @ aka HEAD
new = !git log --name-status $1@{1}..$1@{0} "$@"
# Should prefer this so that autocomplete distinguishes between cherry-pick and cherry
# git-extras has git-cp
chp = cherry-pick
chpa = cherry-pick --abort
chpc = cherry-pick --continue
chpq = cherry-pick --quit
# Like "git show myfile", but uses the last commit that changed "myfile".
showlast = log -n 1 -p
last = log -n 1 -p
# --name-only in log just... adds the name, not *only* shows it? Weird.
# Use format=format: to force the entries to be newlines, removed by grep (`-v '^$'` better?)
most-changed-files = "!git log --name-only --format=format: | grep . | sort | uniq -c | sort -r | head"
# List contributors by number of commits
contributors = "!git --no-pager shortlog --summary --numbered --no-merges"
top-contributors = "!t() { c=${1:-10}; git --no-pager shortlog --summary --numbered --no-merges | head -n $c; }; t"
contributors-merges = "!git --no-pager shortlog --summary --numbered"
top-contributors-merges = "!t() { c=${1:-10}; git --no-pager shortlog --summary --numbered | head -n $c; }; t"
whodid = "!git log -i -1 --pretty='format:%an <%ae>'"
difflog = log -u
# Include date
rl = reflog --pretty=format:"%C(blue)%h\\ %C(reset)%C(dim)%C(italic)%ad%C(auto)%d\\ %s%C(dim)%C(magenta)\\ [%an]" --decorate --date=short
cl = clone
# Show verbose output
tags = tag -n
remotes = remote -v
# Probably branch is more expected, but honestly, I use this more
b = blame
br = branch
# git-extras also has delete-branch, which does upstream
brd = branch -D
# Vaguely risky, but -D outputs the sha, so can easily restore
# Will fail if not a branch (e.g. we had checked out a commit, resulting in a detached head)
delete-last-branch = branch -D @{-1}
# Would prefer this as -simple and -long as just branches, but aliases can't
# overwrite scripts, and unixorn added a bunch of pluralizing scripts in #117
branches = branch -a
local-branches = "!git branch -a --color | grep -v remotes"
branches-long = branch -a -vv
local-branches-long = "!git branch -avv --color | grep -v remotes"
branch-name = copy-branch-name
branch-contains = branch --contains
# More detailed script in unixorn, with dates
recently-checkedout-branches = "!git reflog -n 100 | egrep -io \"moving from ([^[:space:]]+)\" | awk '{ print $3 }' | awk ' !x[$0]++' | egrep -v '^[a-f0-9]{40}$' | head -n 10"
# https://stackoverflow.com/a/5188364/2521092
# Only show most recent 15, could also use branch --sort=-committerdate as of 2.7
# Potentially overridden in local-config to use date=human after 2.21, see also lr and [log]
recent-branches-by-commit = for-each-ref --sort=-committerdate --count=15 refs/heads/ --format="%(color:blue)%(objectname:short)%(color:reset)\\ %(color:bold)%(color:cyan)%(refname:short)%(color:reset)\\ (%(color:italic)%(color:dim)%(color:normal)%(committerdate:relative)%(color:reset))\\ %(contents:subject)\\ %(color:dim)%(color:magenta)[%(authorname)]%(color:reset)"
# More easily rememberable external commands, may or may not exist
remove-merged-branches = delete-merged-branches # git-extras
list-large-files = big-object-report
# Find the commit this commit split off from
# Feels like --fork-point should help but no???
# The trailing # means the $1 and $2 arguments don't get gobbled up along the
# way, should probably make better use of this throughout this config
split-from = "!git merge-base ${1:-$(git default-branch)} ${2:-HEAD} #"
is-ancestor = merge-base --is-ancestor
first-commit = rev-list --max-parents=0 HEAD
rb = rebase
reb = rebase
reba = rebase --abort
rebc = rebase --continue
rebs = rebase --skip
rebq = rebase --quit
rbm = "!git rebase $(git default-branch)"
rebm = "!git rebase $(git default-branch)"
rebd = rebase dev
rebu = rebase @{upstream}
# Interactive rebase with the selected number of latest commits
# Allow for additional flags after
rebi = "!git rebase -i HEAD~$1 \"${@:2}\" #"
# As above, but with the --exec option
rebix = "!git rebase -i -x \"$2\" HEAD~$1 \"${@:3}\" #"
rebim = "!git rebase -i $(git default-branch)"
# Relies on split-from alias, rebases commits since splitting this branch
rebis = "!git rebase -i $(git split-from)"
# Use fzf to pick the interactive rebase, via graton <https://news.ycombinator.com/item?id=32955969>
# Could build on this with some other fzf stuff, see unixorn examples like preview or formatted logs
fzrebi = "!f() { git rebase -i $(git l --color=always | fzf --ansi | cut -d ' ' -f1)^ ; }; f"
# Aww yeah. Autoplace fixes where needed in interactive rebase with --autosquash or rebase.autoSquash
fixup = commit --fixup
# git-extras has a squash command
squash-fixup = commit --squash
# Do the above but automatically move into a rebase
# Need to verify then save sha since since refs like head~2 are treated
# differently by commit and rebase -i (specifically around merges)
fixup-pick = "!sha=$(git rev-parse $1) && git commit --fixup $sha && git rebase -i $sha^ #"
squash-fixup-pick = "!sha=$(git rev-parse $1) && git commit --squash $sha && git rebase -i $sha^ #"
# Push and Pull
po = push origin
pou = push -u origin
pom = "!git push origin $(git default-branch)"
pog = push origin gh-pages
pod = push origin dev
# Use rebase to prevent unnecessary commits
pum = "!git pull --rebase origin $(git default-branch)"
puo = pull --rebase origin
pu = pull --rebase
# Personal remote
pa = push Amorymeltzer
pau = push -u Amorymeltzer
pam = "!git push Amorymeltzer $(git default-branch)"
please = push --force-with-lease
d = diff
dw = diff --word-diff
dc = diff --cached
dwc = diff --cached --word-diff
patience = diff --patience
dn = diff --name-only
dm = "!git diff $(git default-branch)"
dmc = "!git diff --cached $(git default-branch)"
dmn = "!git diff --name-only $(git default-branch)"
dnm = "!git diff --name-only $(git default-branch)"
dnp = "!f() { c=${1:-HEAD}; git diff --name-only $c~ $c; }; f"
du = diff @{upstream}
dun = diff --name-only @{upstream}
duc = diff --cached @{upstream}
# Compare commit to the state before it
dp = "!f() { c=${1:-HEAD}; git diff $c~ $c; }; f"
# Relies on split-from alias, diffs since splitting this branch
ds = "!git diff $(git split-from)"
dsc = "!git diff --cached $(git split-from)"
dns = "!git diff --name-only $(git split-from)"
dsn = dns
stat = diff --stat
# Easier difftool, but default to gui (at least until smerge/emerge makes sense...)
# git diff-tool --tool-help for options
dt = difftool -g
mt = mergetool -g
# Copy sha hashes. Trim new lines since sh's echo doesn't accept -n
hash = "!r() { h=${1:-HEAD}; rev=$(git rev-parse $h); echo $rev; echo $rev | tr -d '\n' | pbcopy 2>/dev/null; }; r"
sha = "!r() { h=${1:-HEAD}; rev=$(git rev-parse --short $h); echo $rev; echo $rev | tr -d '\n' | pbcopy 2>/dev/null; }; r"
short = sha
# Find collisions from a given prefix
collisions = "!r() { git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:'%C(blue)%H %C(reset)%C(dim)%C(italic)%ci %C(dim)%C(magenta)%an %C(auto)%s%n' $commit; done; }; r"
root = rev-parse --show-toplevel
unstage = reset HEAD --
re = reset
reh = reset --hard
res = reset --soft
rehu = reset --hard @{upstream}
resu = reset --soft @{upstream}
# Weird, opposite to add -p? Can choose to stage or unstage items to undo? Useful but confusing
rep = reset --patch
# m just too simple/easy for merge
mg = merge
mgd = merge dev
mga = merge --abort
mgc = merge --continue
# Merge changes when GitHub suggestions have been merged
merge-suggestions = merge --ff-only @{push}
# Find commit in which this commit was merged
# -n is processed before things like --reverse, so we need to pipe to head
merge-commit = "!git log $1..HEAD --ancestry-path --merges --reverse --format='%H' | head -n 1 | xargs git lf1 #"
mg-c = merge-commit
# Assume/Unassume changes
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
# Unused if the git-ignored script is in $PATH, but honestly this might be better, as it doesn't list *everything*, just the folders
ignored = "!git clean -ndX | sed 's/Would remove //g'"
# Show list of files in a conflict state, also present in git-extra-commands
# faster than diff --name-only --diff-filter=U
conflicts = "!git ls-files -u | awk '{print $4}' | sort -u"
# List of leftover conflict markers
# See https://stackoverflow.com/a/49382772/2521092
conflict-markers = diff --check
# Open merge conflicts in editor
edit-unmerged = "!git conflicts | xargs $VISUAL"
add-unmerged = "!git conflicts | xargs git add"
# Script to clustergit check all repos
scan = "!~/bin/gscan"
# Should really learn to use gitk: faster than kraken or vs, and like 85% of all the other apps
# gui for blame or browser (or citool)
k = !gitk
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
ft = "!f() { git describe --always --contains $1; }; f"
# Find commits by source code
fc = "!f() { git log --pretty=format:'%C(blue)%h %C(reset)%C(dim)%C(italic)%ad%C(auto)%d %s%C(dim)%C(magenta) [%an]' --decorate --date=short -S$1; }; f"
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(blue)%h %C(reset)%C(dim)%C(italic)%ad%C(auto)%d %s%C(dim)%C(magenta) [%an]' --decorate --date=short --grep=$1; }; f"
# Show number of commits by minimum length
# Josh Stone @cuviper https://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/
uniq-abbrev=!git rev-list --all --abbrev=0 --abbrev-commit | awk '{ a[length] += 1 } END { for (len in a) print len, a[len] }'
# https://gist.github.com/phinze/83387035c233db7c521e by @phinze
# git timespan FROMREF [TOREF] [FORMAT]
# TOREF: defaults to HEAD
# FORMAT: defaults to %mm%dd
# uses `ddiff` from the `dateutils` package
# available via: brew install dateutils, apt-get install dateutils, etc
timespan = "!f() { one=$(git log -n 1 --format=%ai $1); two=$(git log -n 1 --format=%ai ${2:-HEAD}); ddiff -f ${3:-%yy-%mm-%dd-%Hh-%Mm} \"$one\" \"$two\"; }; f"
# Just for the sake of it
doc = !git --html-path
[push]
default = current
# autoSetupRemote true added in 2.37, makes push assume -u/--set-upstream
# Make `git push` push relevant annotated tags when pushing branches out.
followTags = true
# Currently unsupported by GitHub https://github.community/t/push-signed/938/4
# gpgSign = true
[pull]
ff = only
# Probably obviates the need for the pum/puo/pu aliases?
rebase = true
[fetch]
prune = true
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
# Display base with ||| between ours and theirs, useful if a bit weird
# zdiff3 added with git 2.35, done in local-gitconfig
conflictStyle = diff3
guitool = opendiff
[mergetool]
prompt = false
[rebase]
# Automatically stash before rebase; allows for dirty rebases
autoStash = true
# Automatically file squash! or fixup! prefixed commits where appropriate, --no-autosquash to turn off for incompatible options
autoSquash = true
# Automatically update any other branches that point to anything being rebased
updateRefs = true
# warn but proceed if commits dropped via exclusion, use drop instead
missingCommitsCheck = warn
[apply]
whitespace = warn
[log]
# --date=human added in 2.21, used in local-config, see also lr and recent-branches-by-commit
date = local
abbrevCommit = true
# Follow file rename/move, only if one file
follow = true
[stash]
# stash show shows diff along with stat (showStat, defaults to true) like stash show -p
showPatch = true
[status]
showStash = true
# diffFilter set in local-config
[interactive]
# Mainly for add -p, but don't require pressing enter to proceed
singleKey = true
[help]
# If there's only suggestion from a typo, automatically call it after 1.5s
# As of git 2.34, this can be prompt for interactive, and is in local-config
autoCorrect = 15
# Only added in 2.28, but unlike other config options, doesn't break on older
# versions of git, so safe for legacy systems (no need for .local-gitconfig)
[init]
defaultBranch = main
[diff]
compactionHeuristic = true
noprefix = true
guitool = opendiff
colorMoved = default # zebra (for now). Already the default but set just in case
[difftool]
prompt = false
# Special diffs for special cases
[diff "bin"]
textconv = hexdump -v -C
[diff "zip"]
textconv = unzip -v
[diff "png"]
binary = true
textconv = hexdump -v -C
[diff "jpg"]
binary = true
textconv = hexdump -v -C
[diff "jpeg"]
binary = true
textconv = hexdump -v -C
[diff "plist"]
textconv = plutil -p
[blame]
coloring = highlightRecent
# human in local-config
date = local
[color]
# Use colors in Git commands that are capable of colored output when output is
# to the terminal, not pipes or files (use --color when appropriate)
ui = auto
[color "blame"]
highlightRecent = dim red, 5 years ago, yellow, 2 years ago, blue, 6 months ago, green, 1 month ago, cyan, 1 week ago, normal
[color "branch"]
current = cyan
local = normal
remote = green
# Unlikely?
upstream = red
[color "diff"]
frag = magenta
old = red
new = green
whitespace = red reverse
commit = blue
# Plenty of these, get overriden by bat, and may not even be shown; meta and
# func for sure
meta = dim
func = cyan
# These are the current defaults for log's `--decorate`, no need to change? I
# don't think there's a way to change the defaults for things like the author or
# time or whatever, which is a drag
[color "decorate"]
branch = bold green
remoteBranch = bold red
tag = bold yellow
stash = green
HEAD = bold cyan
# Except maybe this
grafted = bold red
[color "interactive"]
# prompt = blue #bold
header = magenta bold # Not sure what this applies to...
help = yellow
error = red bold # Takes the help color unless otherwise specificed, default is red bold
[color "status"]
# header = normal
branch = cyan
changed = green
added = magenta
untracked = cyan
unmerged = red
# Mainly for diff-so-fancy
[color "diff-highlight"]
oldNormal = red# bold
oldHighlight = red bold 52
newNormal = green# bold
newHighlight = green bold 22
[gc]
reflogExpire = 365 # Default 90 days
reflogExpireUnreachable = 60 # Default 30 days
rerereResolved = 30 # Default is 15
rerereUnresolved = 30 # Default is 15
[tag]
# Implies annotated, which is good behavior anyway
gpgSign = true
# gpg.program set in include
[rerere]
# Tries to remember resolutions of merge conflicts for the next time, seems useful in theory?
enabled = true
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
# Customize based on local environment, newer git versions, etc.
# eg: core.editor, core.pager, gpg, icdiff, ghi
# Example file at .local-gitconfig.example
[include]
path = ~/.local-gitconfig
# user.name, user.email, github.user
path = ~/.config/git/priv-gitconfig
# See git-confirm-hook.sh, via https://github.com/pimterry/git-confirm
[hooks "confirm"]
match = TODO
match = FIXME