-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdot_gitconfig.tmpl
203 lines (137 loc) · 4.35 KB
/
dot_gitconfig.tmpl
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
[user]
# Specify the email address of the author/committer.
email = "{{ .email }}"
# Specify the username of the author/committer.
name = "{{ .name }}"
[alias]
a = commit --amend
br = branch --list --remote
c = commit
ca = !git add -A && gitmoji -c # Commit all changes.
cl = clean -fxd
co = checkout
cp = cherry-pick
d = diff
dc = diff --cached
f = fetch --prune
hash = rev-parse HEAD
lc = shortlog --email --numbered --summary --no-merges # List contributors.
lg = log --graph --date=relative --pretty=format:'%C(bold blue)%h%C(reset) - %C(green)(%ar) %C(white)%s %C(dim white) [%an] %C(bold yellow)%d'
lgall= log --all --graph --date=relative --pretty=format:'%C(bold blue)%h%C(reset) - %C(green)(%ar) %C(white)%s %C(dim white) [%an] %C(bold yellow)%d'
lh = log -p -10 # Show custom log.
p = pull
res = reset --hard HEAD
rlc = reset --hard HEAD~1 # Remove last commit.
s = status
sres = reset --soft HEAD~1 # Undo last commit.
sub = submodule update --init --recursive
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Find commits by source code.
cc = "!f() { \
git log --pretty=custom --decorate --date=short -S\"$1\"; \
}; f"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Find commits by commit message.
cm = "!f() { \
git log --pretty=custom --decorate --date=short --grep=\"$1\"; \
}; f"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# List remote branches.
lrb = "!f() { \
remote="${1:-origin}"; \
git ls-remote --heads "$remote"; \
}; f"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[mergetool]
prompt = false
keepBackup = false
[mergetool "nvim"]
cmd = nvim -f -c DiffviewOpen
[difftool]
prompt = false
[difftool "nvim"]
# TODO: not working
cmd = nvim -f -c DiffviewOpen
[diff]
colorMoved = default
tool = nvim
[merge]
conflictstyle = diff3
tool = nvim
[color]
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
commit = yellow bold
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[core]
abbrev = 12
attributesfile = ~/.gitattributes
editor = nvim
excludesfile = ~/.gitignore
eol = lf
autocrlf = false
fileMode = false
pager = delta
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[interactive]
diffFilter = delta --color-only
[delta]
syntax-theme = zenburn
navigate = true
light = false
true-color = always
[diff "bin"]
# Use `hexdump` to diff binary files.
textconv = hexdump -v -C
[pretty]
custom = "%C(magenta)%h%C(red)%d %C(yellow)%ar %C(green)%s %C(yellow)(%an)"
# │ │ │ │ └─ author name
# │ │ │ └─ message
# │ │ └─ date (relative)
# │ └─ decorations (branch, heads or tags)
# └─ hash (abbreviated)
[push]
# Make `git push` automatically push relevant
# annotated tags when pushing branches out.
default = simple
followTags = true
[user]
# Don't guess the user's identity.
# https://github.com/git/git/blob/90f7b16b3adc78d4bbabbd426fb69aa78c714f71/Documentation/config.txt#L2847-L2855
useConfigOnly = true
[url "git@github.com:"]
insteadOf = https://github.com/
[pull]
rebase = false
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
[credential "https://github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/usr/bin/gh auth git-credential