-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
154 lines (122 loc) · 4.6 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
[user]
email = [email protected]
name = Dylan Irlbeck
[alias]
cleanup = "!git remote prune origin && git gc && git clean -df && git stash clear"
# find commits by source code
fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
# From https://blog.jez.io/cli-code-review/.
#
review-base = !git merge-base HEAD \"${review_base:-origin/master}\"
# list files which have changed since REVIEW_BASE
# (REVIEW_BASE defaults to 'master' in my zshrc)
files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
# Same as above, but with a diff stat instead of just names
# (better for interactive use)
stat = !git diff --stat $(git review-base)
# Open all files changed since REVIEW_BASE in Vim tabs
# Then, run fugitive's :Gdiff in each tab, and finally
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
review = !nvim -p $(git files) +\"tabdo vert Gdiff ${review_base:-origin/master}\" +\"let g:gitgutter_diff_base = '${review_base:-origin/master}'\"
# Same as the above, except specify names of files as arguments,
# instead of opening all files:
# git reviewone foo.js bar.js
reviewone = !nvim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
# For when the diff is too big to review with :Gdiff
diff-review = !git diff $(git review-base)
# Review by commit
by-commit = !git log -p --reverse $(git review-base)..HEAD
# split-diff, using icdiff
icdiff = --paginate difftool --tool icdiff
# show the before, changes, and after for one tracked image
diff-img = difftool --tool imgdiff
# Show just the subject and body of a particular commit (default: HEAD)
message = log -n1 --format=\"%s%n%n%b\"
# Show a markdown-formatted summary of commits from {review_base:-origin/master} until HEAD
pr-summary = !git log --reverse --format=\"- **%s** (%h)%n%n%w(74,2,2)%b\" \"${review_base:-origin/master}\"..HEAD
# Get last commit authored by me
my-last = log -n1 --format=\"%H\" --author=\"\\([jJ]ake\\)\\|\\([jJ]acob\\) [zZ]immerman\"
root = rev-parse --show-toplevel
head = rev-parse HEAD
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[core]
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
editor = nvim
# Treat spaces before tabs and all kinds of trailing whitespace as an error
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of a line
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on macOS
# 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 = true
# Speed up commands involving untracked files such as `git status`.
# https://git-scm.com/docs/git-update-index#_untracked_cache
untrackedCache = true
safecrlf = false
fsmonitor = true
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[delta]
plus-style = "syntax #012800"
minus-style = "syntax #340001"
syntax-theme = Monokai Extended
navigate = true
[interactive]
diffFilter = delta --color-only
# git mergetool
[merge]
tool = vscode
conflictstyle = diff3
[mergetool]
prompt = true
keepBackup = false
[mergetool "vscode"]
cmd = code --wait $MERGED
[difftool]
prompt = false
[diff]
tool = vimdiff
# Show blocks of moved text of at least 20 alphanumeric characters differently than adds/deletes
# https://blog.github.com/2018-04-05-git-217-released/
colorMoved = zebra
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"
# correct typos
[help]
autocorrect = 1
# push easily. http://stackoverflow.com/a/23918418/89484
[push]
default = current
followTags = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[fetch]
prune = true # Remove stale refs to remote from, e.g., reflog and autocomplete
[stash]
showPatch = true
[log]
date = relative
[init]
defaultBranch = main