-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
304 lines (292 loc) · 10.9 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
304 lines (292 loc) · 10.9 KB
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
[alias]
# ── Workflow ────────────────────────────────────────────────────────────────
mainbranch = "!git remote show origin | sed -n '/HEAD branch/s/.*: //p'"
synced = "!git pull origin $(git mainbranch) --rebase"
update = "!git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase"
sync-upstream = !git fetch upstream && git rebase upstream/`git rev-parse --abbrev-ref HEAD`
squash = "!git rebase -v -i $(git mainbranch)"
publish = push origin HEAD --force-with-lease
cont = rebase --continue
# ── Add & Stage ─────────────────────────────────────────────────────────────
a = add
ada = add -A
adf = !git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add
adu = !git diff --name-only --cached | fzf -m --print0 | xargs -0 git restore --staged
unstage = reset HEAD --
# ── Commit ──────────────────────────────────────────────────────────────────
c = commit
cm = commit --verbose
amend = commit -a --amend
cane = commit --amend --no-edit
undo = reset --soft HEAD~1
# ── Branch & Checkout ───────────────────────────────────────────────────────
br = branch -v
cbr = rev-parse --abbrev-ref HEAD
co = checkout
cob = checkout -b
coc = !git branch | fzf | xargs git checkout
# ── Diff ────────────────────────────────────────────────────────────────────
d = "!git diff --ignore-space-at-eol -b -w --ignore-blank-lines -- ':!**/package-lock.json' ':!**/yarn.lock'"
dfc = diff --cached
wdiff = diff --color-words
wshow = show --color-words
# ── Status & Info ───────────────────────────────────────────────────────────
s = status -s -b
la = "!git config -l | grep alias | cut -c 7-"
remotes = remote -v
lt = describe --tags --abbrev=0
count = shortlog -sn
# ── Log ─────────────────────────────────────────────────────────────────────
l = log --graph --pretty=format:'%Cred%h%Creset %C(bold blue)%an%C(reset) - %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
lgs = !git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | fzf --preview 'echo {} | cut -f1 -d\" \" | xargs git show --color'
history = log --graph --decorate --pretty=format:'%C(yellow)%h%Creset %C(auto)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short --date-order -n30
# ── Fetch & Pull & Push ────────────────────────────────────────────────────
pl = !git pull origin `git rev-parse --abbrev-ref HEAD`
ps = !git push origin `git rev-parse --abbrev-ref HEAD`
# ── Rebase & Cherry-pick ────────────────────────────────────────────────────
rb = rebase
cp = cherry-pick
# ── Stash (fzf-powered) ────────────────────────────────────────────────────
ss = stash push
sl = !git stash list | awk -F':' '{print $1}' | fzf --preview 'git -c color.ui=always stash show -p {}'
sp = !git stash pop `git stash list | awk -F':' '{print $1}' | fzf --preview 'git -c color.ui=always stash show -p {}'`
sd = !git stash drop `git stash list | awk -F':' '{print $1}' | fzf --preview 'git -c color.ui=always stash show -p {}'`
# ── Blame (fzf-powered) ────────────────────────────────────────────────────
bl = !"f() { git blame $1 | fzf --preview 'echo {} | cut -f1 -d\" \" | xargs git show --color'; }; f"
# ── GitHub ──────────────────────────────────────────────────────────────────
op = !gh repo view --web
opg = !gh repo view `ghq list | fzf | cut -d "/" -f 2,3` --web
opi = !gh issue view `gh issue list | fzf` --web
opp = !gh pr view `gh pr list | fzf` --web
# ── Submodule ───────────────────────────────────────────────────────────────
sub = "!git submodule sync && git submodule update"
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[blame]
date = human
[branch]
# Show most recently changed branches first.
sort = -committerdate
autosetuprebase = always
[branch "master"]
remote = origin
merge = refs/heads/master
mergeoptions = --no-edit
[user]
name = {{ .name }}
email = {{ .email }}
github = {{ .github_login }}
{{- if .gpgsign }}
# signingkey = {{ .signkey_id }}
{{- if .gpgsign2 }}
signingkey = {{ .signkey_id2 }}
email = {{ .email2 }}
{{- end }}
{{- end }}
[core]
attributesfile = ~/.gitattributes
excludesfile = "~/.gitignore"
hooksPath = ~/.config/git/template
editor = code --wait
preloadindex = true
abbrev = 12
autocrlf = input
# Make `git rebase` safer on OS X
# 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
# Speed up commands involving untracked files such as `git status`.
# https://git-scm.com/docs/git-update-index#_untracked_cache
untrackedCache = true
ignorecase = false
commitGraph = true
whitespace = fix
quotepath = false
[color]
diff = auto
branch = auto
status = auto
showbranch = auto
interactive = auto
grep = auto
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[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]
# Enable via: git config --global commit.gpgsign true
# gpgsign = {{ .gpgsign }}
template = ~/.config/git/template/commit
{{ if eq .chezmoi.os "darwin" }}
[credential]
helper = osxkeychain
[credential "https://gist.github.com"]
helper = !/usr/bin/gh auth git-credential
{{ end }}
[help]
autocorrect = 1 # Automatically correct and execute mistyped commands
[delta]
line-numbers = true
plus-color = "#012800"
minus-color = "#340001"
features = unobtrusive-line-numbers decorations
whitespace-error-style = 22 reverse
syntax-theme = base16-256
navigate = true
[delta "unobtrusive-line-numbers"]
line-numbers = true
line-numbers-left-format = "{nm:>4}┊"
line-numbers-right-format = "{np:>4}│"
line-numbers-left-style = blue
line-numbers-right-style = blue
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
commit-style = raw
hunk-header-decoration-style = yellow box
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax
[delta "interactive"]
keep-plus-minus-markers = false
[diff]
renames = copies # Detect copies as well as renames
algorithm = histogram
colorMoved = default
guitool = meld
mnemonicprefix = true
noprefix = true
submodule = log
tool = delta
[diff "bin"]
textconv = hexdump -v -C
[diff "hex"]
textconv = hexdump -v -C
binary = true
[diff "zip"]
textconv = unzip -v
[diff "pdf"]
textconv = mdls
[diff "sopsdiffer"]
textconv = sops -d
[diff "plist"]
textconv = plutil -convert xml1 -o -
[difftool]
prompt = false
[difftool "delta"]
cmd = delta $LOCAL $REMOTE
[difftool "nvimdiff"]
cmd = nvim -d $LOCAL $REMOTE
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[rebase]
autosquash = true
autostash = true
[remote "origin"]
prune = true
[rerere]
enabled = true
[init]
defaultBranch = main
templateDir = ~/.config/git/template/
[interactive]
diffFilter = delta --color-only --features=interactive
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[push]
default = simple
followTags = true
[pull]
rebase = true
autostash = true
ff = only
[github]
token = {{ .github_token }}
user = {{ .github_login }}
[gpg]
program = gpg
[grep]
lineNumber = true
patternType = extended
extendRegexp = true
[ghq]
vcs = github
root = ~/Dev/_GitHub
[fetch]
prune = true
[filter "gitignore"]
clean = "sed '/#gitignore$/'d"
smudge = cat
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[filter "media"]
clean = git media clean %f
smudge = git media smudge %f
required = true
[status]
showUntrackedFiles = all
[stash]
showPatch = true
[log]
date = local
decorate = full
[merge]
log = true # Include summaries of merged commits in newly created merge commit messages
ff = false
conflictstyle = diff3
tool = meld
stat = true
[merge "ours"]
driver = true
[mergetool]
prompt = false
keepBackup = false
[mergetool "nvimdiff"]
cmd = nvim -d $LOCAL $BASE $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
trustExitCode = true
[mergetool "meld"]
cmd = meld $LOCAL $BASE $REMOTE --output=$MERGED --auto-merge
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[url "[email protected]:github"]
insteadOf = "https://github.com/github"
insteadOf = "github:github"
insteadOf = "git://github.com/github"
[url "[email protected]:"]
pushInsteadOf = "https://github.com/"
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:"