forked from matthewmccullough/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
253 lines (233 loc) · 9.76 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
[user]
name = Kajsa Anderson
email = [email protected]
[color]
# ui = true is a superset of all the more specific color options
# as documented at http://book.git-scm.com/5_customizing_git.html
# When set to always, always use colors in all git commands which are capable of colored output.
# When false, never. When set to true or auto, use colors only when the output is to the terminal.
# When more specific variables of color.* are set, they always take precedence over this setting.
# Defaults to false.
ui = auto
# diff = auto
# status = auto
# branch = 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 "status"]
#added = yellow
#changed = green
#untracked = cyan
[core]
excludesfile = ~/.gitignore
quotepath = false
autocrlf = input
safecrlf = warn
editor = vim
whitespace = trailing-space,space-before-tab,tab-in-indent
pager = `brew --prefix git`/share/git-core/contrib/diff-highlight/diff-highlight | less
[alias]
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
pub = "!git push -u origin $(git branch-name)"
# Delete the remote version of the current branch
unpub = "!git push origin :$(git branch-name)"
br = branch
bra = branch -a
s = status -u -s
cl = log --stat -C -2
c = commit
co = checkout
d = diff --color-words
dh = diff HEAD
dc = diff --staged
dw = diff --word-diff
dcw = diff --color-words
dm = !git diff | mate
dn = diff --name-only
dv = !git diff | vim
who = shortlog -s --
ph = push
pl = pull
lp = log -p
lod = log --oneline --decorate
lg = log --graph
logg = log --oneline --abbrev-commit --decorate --graph
lpo = log --pretty=oneline --abbrev-commit --graph --decorate --all
l1 = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
l2 = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
l3 = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lf = log --pretty=fuller
lsm = log -M --stat
hse = log --stat -5
lwr = log --stat -C
logr = log -M
logr2 = log --stat -M -2
logit = log --stat -M
l = log --stat -C
ll = log --stat -C -3
ignorechanges = update-index --assume-unchanged
noticechanges = update-index --no-assume-unchanged
gc-ap = gc --aggressive --prune
listconf = config --global --list
cam = commit -a -m
scrub = !git reset --hard && git clean -fd
pubdev = !git pub checkout master && git pull && git checkout dev && git rebase master && git checkout master && git merge dev && git wtf
rv = remote -v
pur = pull --rebase
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
orphank = !gitk --all `git reflog | cut -c1-7`&
orphanl = !git log --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`
k = !exec gitk --all&
testecho1 = !sh -c 'echo with slash: zero=$0 one=$1 two=$2' -
# te1 RESULT: with slash: zero=- one=A two=B
testecho2 = !sh -c 'echo without slash: zero=$0 one=$1 two=$2'
# te2 RESULT: without slash: zero=A one=B two=C
st = status
purgeme = !git clean -fd && git reset --hard
prunenow = gc --prune=now
ri = rebase --interactive --autosquash
lol = log --pretty=oneline --graph --abbrev-commit --all
blg = log --graph --decorate --all --abbrev-commit --pretty=oneline
slog = log --graph --simplify-by-decoration --all --abbrev-commit --pretty=oneline
lgso = log --graph --date=short --pretty=format:'%C(yellow)%h%Creset %cn%x09%cd %s%C(green bold)%d'
logsimple = log --graph --abbrev-commit --pretty=oneline --all --decorate
gwcl = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
rlog = log --color-words --stat -3
lm = log --stat -M
logm = log --stat -M
logcpy = log --stat -1 -C -C
nfjsunpushed = log origin/master..master --oneline
noderelnotes = git log --graph --pretty=format:'%h%d %s (%an)'
ro = !git fetch origin && git reset --hard origin/master
shorten = "!sh -c 'curl -i http://git.io -F url=$1' -"
pushnotes = !sh -c 'git push $1 refs/notes/*' -
fetchnotes = !sh -c 'git fetch $1 refs/notes/*:refs/notes/*' -
showignored = clean -ndX
showignored2 = ls-files --others --ignored --exclude-standard
showuntracked = ls-files --others --exclude-standard
rmmissing = !git rm $(git ls-files --deleted)
mergekeepoursonly = merge -s ours
redocommit = reset --soft HEAD^
listunstaged = diff --name-status
liststaged = diff --name-status --staged
listhistory = log --name-status
logn = log --oneline --name-only
logme = log --author=Kajsa --stat -C
serveall = !git daemon --base-path=/Users/u0041298/projects /Users/u0041298/projects --export-all --reuseaddr --informative-errors --verbose --enable=receive-pack
servehere = daemon --verbose --informative-errors --reuseaddr --export-all --base-path=. --enable=receive-pack
busypeople = shortlog -6
busythisweek = shortlog --since=one.week.ago
configpushtracking = config push.default tracking
configpushnothing = config push.default nothing
configpushtracking = config push.default matching
configpushcurrent = config push.default current
fixup = "!sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -"
squash = "!sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -"
ccfq = "!sh -c 'git add $1 && git commit -m\"Placeholder\"' -"
cob = checkout -b
sno = show --name-only
#Searches
#https://git.wiki.kernel.org/index.php?title=Aliases
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
abbr = "!sh -c 'git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:\"%H %ci %an %s%n\" $commit; done' -"
oneline ="!_() { $(test $# -eq 0 && echo xargs -L1) git log --no-walk --decorate --oneline \"$@\"; }; _"
tips = "!_() { t=$(git rev-list --no-merges --max-count=1 \"$@\"); if test -n \"$t\"; then echo $t; _ \"$@\" ^$t; fi; }; _"
empty-tree-sha1 = hash-object -t tree /dev/null
whitespaceviolations = "!git diff --check $(git empty-tree-sha1)"
patchforthis = "!git diff -p $(git empty-tree-sha1)"
tagcontains = git tag -l --contains HEAD
cc-cache = "config --global credential.helper 'cache --timeout=300'"
cc-off = "config --unset --global credential.helper"
cc-helperosx = "config --global credential.helper 'osxkeychain'"
cc-helperwin = "config --global credential.helper 'wincred'"
cc-helperlin = "config --global credential.helper '/pathto/git-credential-gnome-key'"
rtheirs = !git checkout --theirs ./ && git add . && git rebase --continue
logfive = !git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all -5
configsimplelog = config format.pretty oneline
listignored = ls-files --others -i --exclude-standard
check-whitespace = !git diff-tree --check $(git hash-object -t tree /dev/null) HEAD
# from Ken Williams:
# Prune any dangling tracking branches, and any local branches that are supposed to sync to them
pruneitgood = "!f() { \n\
git remote prune origin; \n\
git branch -vv | perl -nale 'system(qw(git branch -d), $F[0]) if $F[3] eq q{gone]}'; \n\
}; f"
[apply]
whitespace = fix
[rerere]
enabled = true
[difftool]
prompt = false
[diff]
tool = Kaleidoscope
# renames = true
[mergetool]
prompt = false
keepBackup = false
[merge]
tool = Kaleidoscope
[fetch]
prune = true
[branch]
# Automatically set up pull to be --rebase
#autosetuprebase = always
[url "git://github.com/"]
insteadOf = "ghg://"
pushInsteadOf = "ghg://"
# Example: git clone ghg://ntschutta/emacs
[url "git://github.com/kajsa/"]
insteadOf = "ghgm://"
pushInsteadOf = "ghgm://"
# Example: git clone ghgm://hellogitworld
[url "[email protected]:"]
insteadOf = "ghs://"
pushInsteadOf = "ghs://"
[url "[email protected]:kajsa/"]
insteadOf = "ghsm://"
pushInsteadOf = "ghsm://"
[url "https://github.com/"]
insteadOf = git://github.com/
pushInsteadOf = "ghh://"
[url "https://github.com/kajsa/"]
insteadOf = "ghhm://"
pushInsteadOf = "ghhm://"
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[difftool "p4merge"]
cmd = \"/Applications/p4merge.app/Contents/Resources/launchp4merge $LOCAL $REMOTE\"
[http]
# proxy=http://something
[hub]
protocol = ssh
[gist]
private = yes
browse = yes
[credential]
helper = osxkeychain
[push]
default = simple
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[filter "lfs"]
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f