-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
325 lines (272 loc) · 9.21 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
[user]
# set email per machine in $GIT_AUTHOR_EMAIL or per repo
name = n am
email = [email protected]
[credential]
# TODO document
helper = osxkeychain
[core]
# autocrlf = false
editor = mvim -f
excludesfile = ~/.gitignore_global
filemode = true
# proxy settings TODO
# gitProxy="ssh" for "kernel.org"
# gitProxy=default-proxy ; for the rest
logallrefupdates = true
# set pager = "" don't use 'more' or 'less' pagers since i am restricting the number of commits displayed anyway
# plus this eliminates the "press any key" prompt at the end of each output
pager = ""
quotepath = false
whitespace = space-before-tab, trailing-space
[achievement]
upload = true
[advice]
statushints = false
[alias]
# Add
a = add
ai = add --interactive
# add files to repo
au = !git ls-files --other --exclude-standard -z | xargs -0 git add -Nv
# wip = !git add -u && git commit -m ...
# wipc = !date >> WIP && git add WIP && git commit -m ...
# Branch
b = branch -a
br = branch -avv
branches = !legit branches
# branches = branch -a
current-branch = "!r=$(git symbolic-ref HEAD);echo ${r##refs/heads/}"
currentbranch = !git branch --contains HEAD | grep '*' | tr -s ' ' | cut -d ' ' -f2
delete-local-branch = branch -D
delete-remote-branch = push origin --delete
delete-local-reference-to-remote-branch = branch -rd
in = "!b=$(git current-branch);git ll $b..origin/$b"
# Commit
c = commit --verbose -m
cv = commit --verbose
# cvv = !git-cv
# Diff
both = diff HEAD
d = diff --word-diff
dc = diff --cached
df = diff --word-diff
diffstat = diff --stat
ds = diff --stat
filelog = log -u # show changes to a file
staged = diff --cached
vimdiff = difftool -y -t mvimdiff # type "git vimdiff" to view a diff in macvim
# amend to a previous commit
fixup = !sh -c 'git commit --fixup $1 && git stash && git rebase -i $1~1 && git stash pop' -
fo = fetch origin
fu = fetch upstream
# fp = format-patch --stdout
# fetch from all remotes and reset to origin/master
fresh = !git fetch --all && git reset --hard origin/master -
# Log
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
gl = !git lg $(git show-ref | cut -d \" \" -f 2 | grep -v stash$)
gll = log -12 --color=always --all --graph --topo-order --pretty='format:%Cgreen%h%Creset %s %C(black bold)(by %an)%Creset%C(yellow bold)%d%Creset%n'
glll = log --color=always --all --graph --topo-order --pretty='format:%Cgreen%h%Creset %s %C(black bold)(by %an)%Creset%C(yellow bold)%d%Creset%n'
glog = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit
graph = log --oneline --graph
greplog = log -U1 -G
l = log --graph --decorate --pretty=format:'%C(magenta)%h%C(reset)%C(bold yellow)%d%C(reset) %s %C(green)%an %C(bold black)%cr%C(reset)' --abbrev-commit --date=relative --max-count=25
la = !git ll --all
lal = log --graph --abbrev-commit --date=relative --all
lall = log --graph --pretty="format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset" --since="1 week ago"
last = log -1
lg = log --oneline --decorate --ignore-all-space --ignore-space-change --date=relative --graph --max-count=10 --since=\"1 month ago\" --stat
lgg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ll = log --pretty=oneline --abbrev-commit --max-count=15
llg = log --summary -n10
lll = log --pretty=format:\"%Cgreen%ad%Creset | %s%d [%Cblue%an%Creset]\" --ignore-all-space --ignore-space-change --graph --date=relative --max-count=10 --since=\"1 month ago\" --stat
lol = log --graph --decorate --pretty=oneline --abbrev-commit --date=relative --graph --max-count=50 --since=\"1 month ago\"
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
lolal = log --graph --decorate --pretty=oneline --abbrev-commit --all
lolalnp = !git --no-pager lolal
loll = log --graph --decorate --pretty=oneline --abbrev-commit
lolnp = !git --no-pager loll
oneline = log --oneline
review = log -p --max-count=1
shviz = !git shortlog -s | cut -f1 | spark
# Leftoff
# provides overview of state of the repo (status, log, commit history, branches, remotes, etc.)
leftoff = !echo \"\\n*** \t\tSTATUS LIST\" && git status list && echo \"\\n*** \t\tSTATUS\" && git status && echo \"\\n*** \t\tLOG\" && git log --pretty=oneline --abbrev-commit --max-count=10 && echo \"\\n*** \t\tBRANCHES\" && git branch -avv
# List
list = ls-files
ls = ls-files
# Merge
mergef = merge --ff-only
mf = merge --ff-only
# Pull
p = pull
pp = !git pull --rebase && git push
up = pull --rebase
out = "!b=$(git current-branch);git ll origin/$b..$b"
praise = blame
pu = push
publish = !legit publish \"$@\"
serve = daemon --reuseaddr --base-path=. --export-all --verbose
# sh = !git-sh
sprout = !legit sprout \"$@\"
# Remote
r = remote show origin
ra = remote add
remotes = remote -v
rv = remote -v
# Rebase
rc = rebase --continue
# useful rebasing your topic branch against the newest version of master
rom = rebase origin/master
rs = rebase --skip
# Reset
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
unstage = reset HEAD # remove files from index (tracking)
# Status
ignored = status --ignored
s = status -sb
st = status -sb
statusuntracked = status -sb -u no
untracked = status -u
# Stash
stash = stash
stasha = stash apply
stashl = stash list
stashls = stash list
# Submodule
sub = submodule
subup = submodule foreach 'git pull'
# Tags
t = tag -n
tags = tag -l
# Whatchanged
wc = whatchanged -n 1
wc6h = !git whatchanged --since=\"6 hours ago\" --format=oneline
wc2d = !git whatchanged --since=\"2 days ago\" --format=oneline
wc6d = !git whatchanged --since=\"6 days ago\" --format=oneline
wc1w = !git whatchanged --since=\"1 week ago\" --format=oneline
wc1m = !git whatchanged --since=\"1 month ago\" --format=oneline
wp = whatchanged -p
# TODO: unsorted
browse = !hub browse
cat = !cat @
chunkyadd = add --patch # stage commits chunk by chunk
co = checkout
compare = !hub compare
# grab = !git-grab
graft = !legit graft \"$@\"
harvest = !legit harvest \"$@\"
id = rev-parse
switch = !legit switch \"$@\"
sync = !legit sync \"$@\"
# thanks = !git-thanks
# track = !git-track
unpublish = !legit unpublish \"$@\"
w = !hub browse
[apply]
# automagically fix whitespace
whitespace = fix
[branch]
autosetupmerge = true
autosetuprebase = always
# *branch-name*.rebase = true
[color]
branch = auto
diff = auto
status = auto
ui = auto
interactive = auto
pager = true
wtf = true
[color "branch"]
current = green bold
local = blue
remote = magenta
[color "diff"]
meta = cyan bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
showUntrackedFiles = no
relativePaths = true
submodulesummary = 0
#[diff]
# external = extDiff
# external = mvimdiff -f #/usr/local/bin/diff-wrapper
# external = git_diff_wrapper
# tool = mvimdiff
# [difftool]
# TODO document
# prompt = false
# [difftool "sourcetree"]
# cmd = " "
# path =
[github]
user = mt3
token = $GITHUB_TOKEN
[help]
format = web # view all "git help cmd" within a browser
autocorrect = 0 # default beahaviour
# [include]
# path = .githubconfig
#[merge]
# tool = mvimdiff
# summary = true
#[mergetool "mvimdiff"]
# cmd = extMerge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
# trustExitCode = false
# [mergetool "sourcetree"]
# cmd = " "
# trustExitCode = true
# [pager]
# this is needed for viewing diffs in macvim
# diff =
[push]
default = tracking # prevent accidental pushes to branches u ain't ready 2 push to yet
# default = upstream
#[rebase]
# autosquash = true
# [rerere]
# enabled = true
# autoupdate = true
[wtf]
all = true
long = true
[wtf "show"]
relations = true
[difftool "sourcetree"]
cmd = " "
path =
[mergetool "sourcetree"]
cmd = " "
trustExitCode = true
[mergetool]
keepBackup = true
# read from given uri, push to writable one (http://bit.ly/g9c9Y2)
# can do 'git clone github:lenary/guides.git' & 'git clone gist:806037'
[url "http://github.com/"]
insteadOf = "gh:"
[url "[email protected]:"]
pushInsteadOf = "https://github.com/"
pushInsteadOf = "http://github.com/"
pushInsteadOf = "gh:"
[url "[email protected]:mt3/"]
pushInsteadOf = "gm:"
[url "http://github.com/mt3/"]
insteadOf = "gm:"
[url "https://gist.github.com/"]
insteadOf = "gist:"
[url "[email protected]:"]
pushInsteadOf = "https://gist.github.com/"
pushInsteadOf = "http://gist.github.com/"
pushInsteadOf = "gist:"
[url "[email protected]:"]
insteadOf = "heroku:"
[web]
browser = open
# vim: set ft=.gitconfig foldmethod=indent: