-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitconfig
350 lines (262 loc) · 12 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
[user]
name = Stephen Tudor
email = [email protected]
[github]
user = smt
[credential]
helper = osxkeychain
[core]
autocrlf = input
whitespace = space-before-tab, trailing-space
excludesfile = ~/.gitignore_global
editor = vim
safecrlf = false
[color]
ui = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red reverse
new = green reverse
whitespace = white reverse
[color "status"]
added = green
changed = yellow
untracked = cyan
[diff]
mnemonicprefix = true
renames = copies
prompt = false
tool = sourcetree
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[merge]
log = true
tool = sourcetree
[mergetool]
keepBackup = false
prompt = false
[mergetool "fugitive"]
cmd = vim -f -c "Gdiff" "$MERGED"
[mergetool "sourcetree"]
cmd = ~/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[branch]
autosetupmerge = true
[push]
default = simple
[apply]
whitespace = fix
[rerere]
enabled = true
[advice]
statusHints = true
[url "[email protected]:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
pushInsteadOf = "https://github.com/"
[url "https://github.com/"]
insteadOf = "github:"
insteadOf = "git://github.com/"
[url "[email protected]:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
pushInsteadOf = "https://gist.github.com/"
[url "https://gist.github.com/"]
insteadOf = "gist:"
# Any GitHub repo with my username should be checked out r/w by default
# http://rentzsch.tumblr.com/post/564806957/public-but-hackable-git-submodules
[url "[email protected]:smt/"]
insteadOf = "git://github.com/smt/"
insteadOf = "https://github.com/smt/"
[help]
browser = open
[web]
browser = gitscm
[browser "gitscm"]
cmd = sh -c 'open http://git-scm.com/docs/$(basename $1 .html)' --
[alias]
st = status
a = add
ci = commit
co = checkout
b = branch
l = log --no-merges
m = merge
r = rebase
d = diff
# leave the gun, take the cannoli
uncommit = reset --soft HEAD^
# rollback
rollback = "!git reset $1; git reset --soft HEAD@{1}; git commit -m 'reverting to older revision $1'; git reset --hard; echo"
# get biggest file according to repo history
biggest = "!git rev-list --objects --all | grep `git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -1 | awk '{ print $1 }'`"
# remove from repo but not filesystem
removefromrepo = rm --cached
# remove all remote branches that have been merged
removeallmerged = "!git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d"
# not a fan of random merges
pull = pull --ff-only
# pull all submodules easily
pullall = "!git submodule foreach git pull origin master"
# local exclude
exclude = "!sh -c 'echo "$1" >> .git/info/exclude' -"
# What has changed since...
changelist = "!git whatchanged --since='$1' --oneline | awk '/^:/ {print $6}' | sort -u; #"
# because I always typo git commit --ammend, er, amend
amend = commit --amend
ammend = amend
send-note = send-email --annotate
# various pretty loggers from various places
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
lc = log ORIG_HEAD.. --stat --no-merges
# from http://blog.kfish.org/2010/04/git-lola.html
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ll = log --graph --date=short
# git flow
fs = !git flow feature start
ff = !git flow feature finish $1 && git pull && git push && echo
# from https://git.wiki.kernel.org/index.php/Aliases
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# ignore po files in "git log", sorry translators ;-<
slog = "!sh -c 'git log --no-merges $1 `ls | grep -v ^po`' -"
# typo
rbanch = branch
# commits not pushed to $1
unpushed = cherry -v
# what tag contains the sha
whatrelease = name-rev --name-only
# what branch contains the sha
contains = branch --contains
#from http://serverfault.com/questions/175052/how-to-tell-which-local-branch-is-tracking-which-remote-branch-in-git
upstream = rev-parse --symbolic-full-name --abbrev-ref HEAD@{upstream}
#also from http://serverfault.com/questions/175052/how-to-tell-which-local-branch-is-tracking-which-remote-branch-in-git
tbranch = branch -vv
# what got pushed to master in the last hour
# based on http://stackoverflow.com/questions/3357219/expose-the-date-a-commit-was-pushed-to-a-repository
justpushed = log origin/master@{\"1 hour ago\"}..origin/master --
# log everything with $1 string in the diff
timegrep = log -S
# like above, but show the diff
diffgrep = log -p -S
# search logs for a bugzilla like number
findbug = "!sh -c 'git log --grep ^$1:' -"
# show what tag/release a bug was part of
bugrelease = "!sh -c 'git name-rev --tags --name-only $(git log --grep ^$1: --pretty=\"format:%H\n\")' -"
# from https://gist.github.com/492227
lost = "!git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
# show a log without the formating, occasionaly handy for c&p
rawlog = log --format=\"format:commit %H%nAuthor:%an%n%n%B%n\"
# show a list of branches sorted by time of last commit
brage = "!f() { git for-each-ref --sort=committerdate refs/heads $1 --format=\"%(refname:short)\" ; }; g() { for C in $(f $1) ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; done; }; g "
# show remote branches as well
brageall = !git brage refs/remotes
tbrage = "!f() { git for-each-ref --sort=committerdate refs/heads $1 --format=\"%(refname:short)\" ; }; g() { for C in $(f $1) ; do UP="$(git rev-parse --symbolic-full-name --abbrev-ref $C@{upstream} 2> /dev/null)"; TRACKING=$?; UP=\""-> $UP \""; if [ $TRACKING -ne 0 ] ; then UP=\"\"; fi; git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C $UP\" \"$C\" -- ; done; }; g "
tbrageall = !git tbrage refs/remotes
# show a list of tags sorted by when they were tagged
tagage = "!sh -c 'git for-each-ref --sort=taggerdate refs/tags --format=\"%(refname:short)\"'"
# show a list of every branch and show their latests commit, sorted by last commit
brlog = "!sh -c 'for C in $(git for-each-ref --sort=committerdate refs/heads --format=\"%(refname:short)\") ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; git show --stat -s $C ; echo; done'"
# show a list of last change in each branch of a given path
# roly poly fileheads
fileheads = "!sh -c 'for C in $(git for-each-ref --sort=committerdate refs/heads --format=\"%(refname:short)\"| tac) ; do git show -s --pretty=format:\"%Cgreen%ci %Cblue%cr%Creset $C\" \"$C\" -- ; git --no-pager log -p -1 $C -- $0; echo; done'"
# not useful itself, but handy to remember for use in scripts
thisbranch = rev-parse --abbrev-ref HEAD
# remove a file from index
unadd = !git reset HEAD
# url of origin, about 99% of what I use git config --list for
cloneurl = config --get remote.origin.url
# needs python-bugzilla, and git-showbugs
openbugs = showbugs -s NEW,ASSIGNED,NEEDINFO,FAILS_QA,REOPENED,ON_DEV
closedbugs = showbugs -s PASSES_QA,VERIFIED,RELEASE_PENDING,CLOSED
# show a list of files with bug fixes in them, sorted by popularity of occurance
# aka, list the buggy files
# FIXME: should probably make all the bug regex stuff scripts so it's easier to customize
buggyfiles = !"git log -M -C --format=\"format:%n\" --grep=\"^[[:digit:]]\\+:\" --name-only | grep . | sort | uniq -c | sort -n"
# from https://github.com/cypher/dotfiles/blob/master/gitconfig
ls-ignored = ls-files --exclude-standard --ignored --others
# based on "buggyfiles" above and https://github.com/cypher/dotfiles/blob/master/bin/git-churn
churn = "!git log -M -C --name-only --format=\"format:%n\" | grep . | sort | uniq -c | sort -n"
# uh, don't do this. list authors by numbers of commits. probably needs a .mailmap
churners = shortlog -sn --
# this does the same thing, except slower...
#churners = !"git log -M -C --no-color --format=\"%aN\" | sort | uniq -c | sort -n"
# burners: who last touched the most code according to annotate see git-burners
# alias implementation just for reference
#burners = "!f() { for i in $(git ls-files) ; do git annotate -e $i ; done }; g() { f | awk '{print $2 }' | perl -pe 's/\\(\\<(.+@.+)\\>/\\1/' ; }; g"
#
# yeah, don't do this either. list authors by # of bug id's fixed
# I suppose the really mad could make "breakers" that figures out who commits code
# that breaks. I can save you the time, it was me. I broke it.
fixers = !"git log -M -C --format=\"format:%aN\" --grep=\"^[[:digit:]]\\+:\" | sort | uniq -c | sort -n"
# who reverts the most. Totally useless, but I like the name
poppers = !"git log -M -C --format=\"format:%aN\" --grep \"Revert\" | sort | uniq -c | sort -n"
# shorter alias
lsg = ls-github
# show which python classes have had the most commits
# external script
#buggyclasses = "!f() { git log -M -C -p | pcregrep -o \"@@.*@@\\sclass\\s(.*)\\(.*\\)\" | cut -f5 -d\'@\' | sort | uniq -c | sort -n;}; f"
# ignore local changes to a file
ignore = update-index --assume-unchanged
# http://sandofsky.com/blog/git-workflow.html
# merge code but not history to manually recommit
# for emergency use only
backrupt = merge --squash
# https://github.com/wadey/dotfiles/blob/master/gitconfig
# check if a branch has been merged into the current HEAD
# if on master, "git merged topic" will tell you if topic
# has been merged
merged = !sh -c 'git rev-list HEAD | grep $(git rev-parse $0)'
# https://github.com/prabirshrestha/ProfilesAndSettings/blob/master/.gitconfig
# show tags and any tag annotation (tito adds tag annotations for example)
tags = tag -n1 -l
# https://github.com/aspiers/git-config/blob/master/bin/git-cdup
# could be useful for scripts
cdup = rev-parse --show-cdup
# https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig-alias.txt
# Show the date of the first commit
log-first-date = !"git log --date-order --date=iso --pretty=\"format:%ad\" --reverse | head -1"
# https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig-alias.txt
# Editing and adding conflicted files: when we get many merge conflicts
# and want to quickly solve them using an editor, then add the files.
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
# from https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig-alias.txt
# Thanks to jtolds on stackoverflow
remote-ref = "!bash -c ' \
local_ref=$(git symbolic-ref HEAD); \
local_name=${local_ref##refs/heads/}; \
remote=$(git config branch.\"#local_name\".remote || echo origin); \
remote_ref=$(git config branch.\"$local_name\".merge); \
remote_name=${remote_ref##refs/heads/}; \
echo remotes/$remote/$remote_name'"
# also from https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig-alias.txt
# Thanks to jtolds on stackoverflow
rebase-recent = !git rebase -i $(git remote-ref)
# from http://blog.blindgaenger.net/advanced_git_aliases.html
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ = \\2/' | sort
# http://superuser.com/a/169696
# prettier than my version of this
# doesn't really work, should probably use git for-each-ref
#heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'"
# legit
pconfig = config -f .git/config
switch = !legit switch \"$@\"
branches = !legit branches
sprout = !legit sprout \"$@\"
unpublish = !legit unpublish \"$@\"
harvest = !legit harvest \"$@\"
sync = !legit sync \"$@\"
publish = !legit publish \"$@\"
graft = !legit graft \"$@\"
[hub]
protocol = https