/
gitconfig
298 lines (290 loc) · 10.2 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
[user]
name =
useConfigOnly = true
email =
[core]
#autocrlf = input
# pager = delta --dark --theme base16
# pager = less +X -x2 -R
# pager = most
pager = moar --no-linenumbers
excludesfile = ~/.gitignore
trustctime = false
editor = hx
# trustctime = false
[diff]
renames = copies
tool = vscode
# colorMoved = default
[difftool]
prompt = false
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
minus-style = syntax auto
syntax-theme = base16-tomorrow-night
features = map-styles-dark
# hyperlinks = true
[delta "map-styles-dark"]
map-styles = \
bold purple => syntax "#330f29", \
bold blue => syntax "#271344", \
bold cyan => syntax "#0d3531", \
bold yellow => syntax "#222f14"
[delta "map-styles-light"]
map-styles = \
bold purple => syntax "#feecf7", \
bold blue => syntax "#e5dff6", \
bold cyan => syntax "#d8fdf6", \
bold yellow => syntax "#f4ffe0"
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort
br = branch
ci = commit
cie = commit-edit
co = checkout
cop = checkoutp
st = status -b -s
stat = status -b -s
# --pretty=format:"%H%x20%an%x09%ad%x09%s"
ahead = log --name-status --pretty=onemore --graph HEAD ^origin/HEAD
ahead-root = !git --no-pager log --oneline HEAD ^origin/HEAD
ahead2 = log --name-status --abbrev-commit --pretty=oneline --graph --decorate HEAD ^origin/HEAD
exclude = "!f() { for p in \"$@\" ; do echo \"$GIT_PREFIX$p\" >> $GIT_DIR/info/exclude ; done; }; f"
delta = -c core.pager=deltaw diff
deltac = -c core.pager=deltaw diff --cached
deltas = -c core.pager=deltaw show
diffc = diff --cached
diffd = -c core.pager=deltaw diff
diffcd = -c core.pager=deltaw diff --cached
showd = -c core.pager=deltaw show
stashsd = -c core.pager=deltaw stash show -p
last = -c pager.show=off show --oneline --name-status --decorate
last2 = last --name-status --pretty=twomore
l = log --pretty=oneline --abbrev-commit --decorate --graph
lr = log --pretty=oneline --abbrev-commit --decorate --graph --simplify-by-decoration --tags
lu = logu --pretty=oneline --abbrev-commit --decorate --graph
lup = "!git log --pretty=oneline --abbrev-commit --decorate --graph HEAD @{u} $(git rev-parse --symbolic --glob=\"$(git rev-parse --symbolic-full-name @{u})*\")"
lus = log --pretty=oneline --abbrev-commit --decorate --graph --simplify-by-decoration HEAD @{u}
li = log --pretty=oneline --abbrev-commit --decorate --graph HEAD @{u} # <kbd>i</kbd> is much easier to hit than <kbd>u</kbd>
la = log --pretty=oneline --abbrev-commit --decorate --graph --exclude=refs/stash --exclude=refs/remotes/*/archive/** --exclude=refs/tags/archive/** --all
las = log --pretty=oneline --abbrev-commit --decorate --graph --exclude=refs/stash --exclude=refs/remotes/*/archive/** --exclude=refs/tags/archive/** --all --simplify-by-decoration
laa = log --pretty=oneline --abbrev-commit --decorate --graph --all
lo = log --pretty=oneline --abbrev-commit --decorate --graph --remotes=origin --branches
l2 = log --pretty=onemore --decorate --graph --no-notes
l3 = log --pretty=twoline --decorate --graph --date=local
lg = log --name-status --pretty=oneline --abbrev-commit --decorate --graph
lga = log --name-status --pretty=oneline --abbrev-commit --decorate --graph --all
lg2 = log --name-status --pretty=onemore --graph --no-notes
lg3 = log --name-status --pretty=twoline --graph --date=local
lgp = log -p --pretty=onemore --graph
logd = -c core.pager=deltaw log --pretty=concise
logp2 = logp --pretty=concise
show2 = show --pretty=concise
showd2 = showd --pretty=concise
ll = log --pretty=oneline --abbrev-commit --decorate --graph --branches=*
branches = branch --list
branches-with-upstreams = "!git rev-parse --symbolic --branches | while read branch; do echo $branch; up=$(git rev-parse --symbolic $branch@{u} 2>/dev/null) && echo $up; done"
llu = "!git log --pretty=oneline --abbrev-commit --decorate --graph $(git branches-with-upstreams)"
llus = "!git log --pretty=oneline --abbrev-commit --decorate --graph --simplify-by-decoration $(git branches-with-upstreams)"
shlg = log --name-status --pretty=raw --abbrev-commit --decorate --graph
tracking-status = for-each-ref --format='%(refname:short) <- %(upstream:short)' refs/heads
ignore-for-now = update-index --assume-unchanged
update-branch-upstream = "!f() { branch=${1:-$(git symbolic-ref --short HEAD)}; shift; git update-ref \"refs/heads/$branch\" \"$branch@{u}\" $@; }; f"
push-new-branch = "push -u"
reset-upstream = reset @{u}
root = rev-parse --show-toplevel
tag-column = !git tag "$@" | column
# useful to force make to rebuild changed files; just `| xargs touch`
show-files-only = show --pretty="format:" --name-only
serve = daemon --export-all --base-path=. --verbose
commit-edit = "!git commit --edit --file \"$(git rev-parse --git-dir)/COMMIT_EDITMSG\""
env = "!env"
checkout-pull-detach = "!f() { git checkout \"$@\" && git pull && git detach-head; }; f"
detach-head = checkout --detach HEAD
wt = "worktree"
worktree-dirs = "!git worktree list --porcelain | rg '^worktree ' | sd '^worktree ' ''"
worktree-main = "!git worktree list --porcelain | head -n1 | sd '^worktree ' ''"
worktree-ls = worktree list
worktree-mv = worktree move
worktree-rm = worktree remove
worktree-cd = "worktree cd"
# looks like ripgrep
grep-pretty = "grep --break --heading"
rg = "grep --break --heading"
# legit
# branches = !legit branches
# brs = !legit branches
# graft = !legit graft \"$@\"
# harvest = !legit harvest \"$@\"
# publish = !legit publish \"$@\"
# sprout = !legit sprout \"$@\"
# switch = !legit switch \"$@\"
# sync = !legit sync \"$@\"
# unpublish = !legit unpublish \"$@\"
exec = "!exec "
# aliases for custom commands
sm = subl-modified
sp = subl-projects
unstage = reset HEAD --
dc = diff --cached
amend = commit --amend --no-edit
reword = commit --amend
cob = checkout-branch
checkout-branch = checkout
unresolve = checkout --conflict=merge
config-user = "!git config --local user.name \"$1\" && git config --local user.email \"$2\" && :"
# for ease of use, add a `git-config-signing` in ~/.local/bin with the key id as default
config-signing = "!git config --local user.signingkey \"$1\" && git config --local commit.gpgSign true && git config --local tag.gpgSign true && :"
archive-untracked-files = !git-archive-untracked-files
attach = !git-attach
branch-archive = !git-branch-archive
changed-lines = !git-changed-lines
cleanup-merged = !git-cleanup-merged
file-size-diff = !git-file-size-diff
find-blob = !git-find-blob
has-changes = !git-has-changes
push-feature-deploy = !git-push-feature-deploy
resolve-conflicts = !git-resolve-conflicts
addu = add -u
[color]
# diff = always
grep = auto
interactive = always
status = always
ui = auto
branch = auto
diff = auto
# [color "branch"]
# current = yellow reverse
# local = yellow
# remote = green
# [color "diff"]
# meta = red bold
# frag = cyan bold
# old = red
# new = green
[color "status"]
# added = green
# changed = green
untracked = magenta
[color "grep"]
linenumber="green"
filename="magenta"
[grep]
lineNumber = true
[pager]
branch = false
ahead = less
last = false
ll = true
ls-files = false
[pretty]
concise = "format:%C(yellow)• %H%C(auto)%d%n%C(magenta)♘ %an <%ae> %C(dim)♖ %cn <%ce>%Creset%n%C(blue)✍ %aD %C(dim)♔ %cD%Creset%n%n%-s%n%Creset%n%-b"
onemore = "format:%C(yellow)%h%C(auto)%d%C(magenta) %an %Creset%C(blue)%ar%Creset %s"
twomore = "format:%C(yellow)%h%C(auto)%d%C(magenta) %an %Creset%C(blue)%ar%Creset%n%-s"
twoline = "format:%C(yellow)%h%C(auto)%d%C(magenta) %aE %Creset%C(blue)%ad%C(green)%gn%Creset %n%s"
[giggle]
file-view-vpane-position = 807
history-view-vpane-position = 216
main-window-geometry = 1265x1022+653+27
main-window-maximized = false
main-window-view = HistoryView
show-graph = true
[merge]
#tool = diffuse_windows
#tool = diffuse_custom
tool = smerge
# tool = meld
# tool = meld_merged
# conflictstyle = diff3
[rerere]
enabled = 1
[mergetool "diffuse_custom"]
cmd = /usr/bin/env diffuse \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
#"
[mergetool "diffuse_base"]
cmd = /usr/bin/env diffuse \"$LOCAL\" \"$BASE\" \"$REMOTE\"
#"
[mergetool "meld_merged"]
cmd = /usr/bin/env meld \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
#"
[mergetool "diffuse_windows"]
cmd = \"C:\\Program Files (x86)\\Diffuse\\diffusew.exe\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
#"
[mergetool "diffuse_cygwindows"]
cmd = \"/cygdrive/c/Program Files (x86)/Diffuse/diffusew.exe\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
#"
[mergetool "meld_windows"]
cmd = \"C:\\Program Files (x86)\\Meld\\meld\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"
[github]
user = forivall
# [push]
# default = simple
[push]
default = simple
autoSetupRemote = true
[hub]
protocol = https
[url "git://anongit.kde.org/"]
insteadOf = kde:
# [url "ssh://git@git.kde.org/"]
# pushInsteadOf = kde:
[url "git@git.kde.org:"]
pushInsteadOf = kde:
[url "https://github.com/"]
insteadOf = hub:
[url "git@github.com:"]
pushInsteadOf = hub:
[url "https://gitlab.com/"]
insteadOf = lab:
[url "git@gitlab.com:"]
pushInsteadOf = lab:
[credential]
helper = cache
helper = /usr/local/bin/git-credential-manager
[mergetool]
keeptemporaries = false
keepbackups = false
prompt = false
trustexitcode = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[difftool "vscode"]
cmd = code --wait \"$LOCAL\" \"$REMOTE\" --diff
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[merge "npm-merge-driver"]
name = automatically merge npm lockfiles
driver = npx npm-merge-driver merge %A %O %B %P
[mergetool "vscode"]
cmd = code --wait --merge \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
[mergetool "smerge"]
cmd = smerge mergetool \"$REMOTE\" \"$LOCAL\" \"$BASE\" -o \"$MERGED\"
[commit]
# template = /Users/emilyklassen/.stCommitMsg
[pull]
ff = only
[init]
defaultBranch = main
[extensions]
worktreeConfig = true
[credential "https://dev.azure.com"]
useHttpPath = true
[sequence]
editor = interactive-rebase-tool
[rebase]
autoSquash = true
updateRefs = true
[gui]
editor = vscode
[column]
ui = auto