-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdot_gitconfig
285 lines (232 loc) · 8.91 KB
/
dot_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
[user]
name = Fabrizio (Misto) Milo
email = mistobaan@gmail.com
[core]
excludesfile = ~/.gitignore_global
compress = 6
editor = vim
autocrlf = input
[diff]
tool = vimdiff
conflictstyle = diff3
[difftool]
prompt = false
[difftool "araxis"]
# http://www.araxis.com/merge/documentation-windows/integrating-with-other-applications.en#msysGit
path = /Applications/Araxis Merge.app/Contents/Utilities/compare
[github]
user = mistobaan@gmail.com
[init]
templatedir = ~/.git_template
[merge]
tool = diffconflicts
# Include the summary of merged commits into all newly created merge
# commits. The newly created merge commit will contain a one-line summary
# of every (well, most) merged commits.
log = true
# Show merge statistics after merge.
stat = true
# Show Progress
progress = true
[mergetool "araxis"]
path = /Applications/Araxis Merge.app/Contents/Utilities/compare
[branch "develop"]
mergeoptions=--no-ff
[color]
ui = auto
diff = auto
status = auto
branch = auto
interactive = auto
[alias]
# List all the authors in the branch
branchauthors = "! for branch in `git branch -r | grep -v HEAD`;do echo `git show --format=\"%ai %ar by %an %Cgreen($branch)%Creset \" | head -n 1` \t$branch; done | sort -r"
a = add
am = commit --amend
aaa = add --all
aa = add -u
amend = commit --amend --no-edit
b = branch
ba = branch --all
ci = commit
cm = commit -m
co = checkout
# ctags
ctags = !.git/hooks/ctags
# diff
d = diff -C # find also copies
di = diff -C -w # find copies
dc = diff --cached
dcs = diff --cached -C --stat=160,120
dh1 = diff HEAD~1
serve = daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/
dw = diff -C -w
ds = diff -C --stat
dsp = diff -C --stat -p
dcw = diff -C --word-diff
# list conflicts
lsc = !git diff -C --name-only --diff-filter=U
# show the parent of the current branch
dm = log --merge -p
f = fetch
fa = fetch --all
st = status -s -b -u
fp = "!git push -f origin \"$(git rev-parse --abbrev-ref HEAD)\""
l = log --abbrev-commit --graph --date=relative --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --decorate
la = !git l --all
ll = !git l --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --stat --summary
# this is the most commonly used one, it turns out!
l19 = !git l -19
# and this one can be a real lifesaver on a complex tree
lsd = log --graph --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --all --simplify-by-decoration
# log left-right; requires argument like A...B (3 dots)
lglr= log --graph --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --boundary --left-right --cherry-pick
# list all files
ls = ls-files
# list files non added
lsu = ls-files --other --exclude-standard
# list files ignored
lsi = ls-files --other --exclude-standard -i
head = !git l -1
h = !git head
hp = git show -p --pretty=oneline
r = !git l -20
ra = !git r --all
ref = reflog show --date=relative
refnow = reflog show --date=relative --since='1 hour'
ff = merge --ff-only
pullff = pull --ff-only
noff = merge --no-ff
sl = stash list
sp = stash pop
ss = stash save
# "show-branch -g=N" can't be aliased for N easily, so we stop here:
sb = show-branch
# pg sbt master pu -- if the last line is 'master' and not 'master^'
# or 'master~N' then pu is a descendent of master
sbt = show-branch --topics
sbs = show-branch --sha1-name
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
wtf = whatchanged --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" -p
wtf1 = !git wtf -n 1
gofmt = !gofmt -w `git diff --name-only --cached --diff-filter=AM | grep \"\\.go$\"`
summary = log --pretty=oneline
tree = log --graph --pretty=oneline --abbrev-commit --decorate --color
forest = !git tree --all
recent = !git tree -10
message = log --format=format:%s -1
last = log --format=format:%H -1
revs = log --format=format:%H
preview = diff --staged
# git codereview
change = codereview change
gofmt = codereview gofmt
mail = codereview mail
pending = codereview pending
submit = codereview submit
sync = codereview sync
cleanup = "!git branch --merged | egrep -v '^.*master' | egrep -v '^.*develop' | xargs -n 1 git branch -d"
[credential]
helper = cache
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[init]
templatedir = ~/.git_template
defaultBranch = main
[http]
cookiefile = /Users/fabrizio/.gitcookies
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[push]
default = simple
[difftool]
dc = diff --cached
ds = diff --cached -C --stat=160,120
dh1 = diff HEAD~1
dw = diff -C -w
ds = diff -C --stat
dsp = diff -C --stat -p
dcw = diff -C --word-diff
dt = difftool
# list conflicts
lsc = !git diff -C --name-only --diff-filter=U
# show the parent of the current branch
dm = log --merge -p
f = fetch
fa = fetch --all
st = status -s -b -u
l = log --abbrev-commit --graph --date=relative --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --decorate
la = !git l --all
ll = !git l --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --stat --summary
# this is the most commonly used one, it turns out!
l19 = !git l -19
# and this one can be a real lifesaver on a complex tree
lsd = log --graph --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --all --simplify-by-decoration
# log left-right; requires argument like A...B (3 dots)
lglr= log --graph --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" --boundary --left-right --cherry-pick
ls = ls-files
# list files non added
lsu = ls-files --other --exclude-standard
# list files ignored
lsi = ls-files --other --exclude-standard -if
head = !git l -1
h = !git head
hp = git show -p --pretty=oneline
r = !git l -20
ra = !git r --all
ref = reflog show --date=relative
refnow = reflog show --date=relative --since='1 hour'
ff = merge --ff-only
pullff = pull --ff-only
noff = merge --no-ff
sl = stash list
sp = stash pop
ss = stash save
# "show-branch -g=N" can't be aliased for N easily, so we stop here:
sb = show-branch
# pg sbt master pu -- if the last line is 'master' and not 'master^'
# or 'master~N' then pu is a descendent of master
sbt = show-branch --topics
sbs = show-branch --sha1-name
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
wtf = whatchanged --pretty="format:'%C(yellow)%h%Creset %Cgreen(%ar)%Creset %C(bold blue)< %an> %Creset %Cred%d%Creset %s'" -p
wtf1 = !git wtf -n 1
gofmt = !gofmt -w `git diff --name-only --cached --diff-filter=AM | grep \"\\.go$\"`
[credential]
helper = osxkeychain
keepBackup = false
diffconflictstrustExitCode = true
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[push]
default = matching
[mergetool "diffconflicts"]
cmd = $HOME/dotfiles/bin/diffconflicts vim $BASE $LOCAL $REMOTE $MERGED