-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitconfig
254 lines (217 loc) · 9.23 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
[user]
name = kenorb
email = [email protected]
signingkey = 20640DB6D61A7BBBD3DBF898E95815EEE495E904
[credential]
helper = osxkeychain
[core]
editor = vim
filemode = true
; detect and raise errors about trailing spaces and spaces before tabs
whitespace = trailing-space,space-before-tab
excludesfile = ~/.gitignore
autocrlf = false
pager = delta ; @see: https://github.com/dandavison/delta
[delta]
navigate = true # use n and N to move between diff sections
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
[interactive]
diffFilter = delta --color-only
[push]
default = current
[gc]
auto = 1
[grep]
threads = 20
[color]
branch = auto
diff = auto
status = auto
ui = auto
;[filter "rcs-keywords"]
; clean=.git_filters/rcs-keywords.clean
; smudge=.git_filters/rcs-keywords.smudge %f
# Usage in .gitattributes: some-dotfile filter=remove-pass
[filter "remove-pass"]
clean = "sed -e 's/^password=.*/#password=TODO/'"
[apply]
; strip whitespaces, but only during patch, not "always automatically"
whitespace = fix
[rebase]
autoStash = true
# DIFF section
[diff]
colorMoved = default
tool = diffmerge
guitool = diffmerge
renamelimit = 7274
#[diff "ansible-vault"]
#cachetextconv = false
#textconv = ansible-vault view
[diff "zip"]
textconv = unzip -v
[diff "bin"]
textconv = hexdump -v -C
[diff "pdf"]
textconv = pdfinfo
[diff "utf-16"]
# @see: http://blog.xk72.com/post/31456986659/diff-strings-files-in-git
textconv = "iconv -f utf-16 -t utf-8"
[difftool]
prompt = NO
tool = diffmerge
[difftool "bbdiff"]
cmd = /usr/local/bin/bbdiff --wait --resume "$LOCAL" "$REMOTE" # for BBEdit
[difftool "diffmerge"]
cmd = diffmerge "$LOCAL" "$REMOTE"
keepBackup = false
trustExitCode = true
[difftool "filemerge"]
cmd = /usr/bin/opendiff "$LOCAL" "$REMOTE" # for FileMerge
tool = meld
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[difftool "opendiff"]
tool = opendiff
[difftool "sourcetree"]
cmd = opendiff "$LOCAL" "$REMOTE"
path =
[difftool "twdiff"]
cmd = /usr/bin/twdiff --wait --resume "$LOCAL" "$REMOTE" # for TextWrangler
[difftool "vimdiff"]
tool = vimdiff
#[lfs]
# standalonetransferagent = ipfs
#
#[lfs "customtransfer.ipfs"]
# path = git-lfs-ipfs-cli
# args = transfer
# concurrent = true
# direction = both
#
#[lfs "extension.ipfs"]
# clean = git-lfs-ipfs-cli clean %f
# smudge = git-lfs-ipfs-cli smudge %f
# priority = 0
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[merge]
prompt = false
tool = mergemeld
conflictstyle = diff3
log = yes
[mergetool "mergemeld"]
cmd = meld --auto-merge --output "$MERGED" "$LOCAL" "$BASE" "$REMOTE" --diff "$BASE" "$LOCAL" --diff "$BASE" "$REMOTE"
[mergetool "kdiff3"]
cmd = kdiff3 $LOCAL $BASE $REMOTE -o $MERGED
[alias]
aa = commit --amend --no-edit
aaa = commit --amend --no-edit --all
addremove = !git add . && git ls-files -deleted | xargs git rm
b = branch
br = branch
big-files = !"git rev-list --all \
| xargs -n1 git ls-tree --long -r \
| sort -k3 \
| uniq \
| sort -nk4"
big-files2 = !"git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| sed -n 's/^blob //p' \
| sort -nk2 \
| cut -c 1-12,41- \
| $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest"
big-objects = !"git rev-list --all \
| parallel git ls-tree -r --long "{}" \
| sort -uk3 \
| sort -nk4"
c = checkout
checkout-all = !"find . -name .git -type d -print -execdir git checkout -f HEAD \\;"
ca = commit -a
cp = cherry-pick
cpa = cherry-pick --abort
cm = commit
d = diff
gb = get-branch
diff-stash = stash show -p stash@{0}
get-branch = rev-parse --abbrev-ref HEAD
grep-comments-c = grep --heading -oE "\\\\/\\\\*[^*]*\\\\*+([^\\\\/*][^*]*\\\\*+)*\\\\/"
grep-comments-hash = grep --heading -oEP "(?<=(#)[^#\\\\S]).*"
grep-domains = grep --heading -oE "([a-z0-9]+(-[a-z0-9]+)*\\\\.)+[a-z]{2,}"
grep-emails = grep --heading -oE "\\\\S+@\\\\S+\\\\.[a-zA-Z]+"
grep-handle = grep --heading -oE "@[a-zA-Z]\\\\w{4,}"
grep-hashtag = grep --heading -owE "#[a-zA-Z]\\\\w{4,}"
grep-ip = grep --heading -owE "[0-9]{1,3}\\\\.[0-9]{1,3}\\\\.[0-9]{1,3}\\\\.[0-9]{1,3}"
grep-mailto = grep --heading -oE "mailto:[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\\\.[a-zA-Z0-9.-]+"
grep-number = grep --heading -oEw '[0-9]{2,}'
grep-numbers-sep = grep --heading -oEP "\\\\d+(,.\\\\d+)+"
grep-phone = grep --heading -EP "\\\\(*\\\\+*[1-9]{0,3}\\\\)*-*[1-9]{0,3}[-./\\ ]*\\\\(*[2-9][0-9]{2}\\\\)*[-./\\ ]*[0-9]{3}[-./\\ ]*[0-9]{4} *e*x*t*\\\\.* *[0-9]{0,4}"
grep-quoted = grep --heading -owE -e '\"[^\"]+\"' --or -e \"'[^']+'\"
grep-sha256 = grep --heading -owE "[A-Fa-f0-9]{64}"
grep-tag = grep --heading -EP -e "(?<=(<))[^<]?+\\\\w+"
grep-text-bracket = grep --heading -EP -e "(?<=(\\\\())[^\\\\(][^)]{3,100}" --or -e "(?<=(\\\\[))[^\\\\]]{3,100}" --or -e "(?<=({))[^{][^}]{3,100}" --or -e "(?<=(<))[^<][^>]{3,100}"
grep-text-tag = grep --heading -EP "(?<=(>))[^<]+"
grep-uri = grep --heading -oE "[-a-zA-Z0-9@:%._+~#=]{1,256}\\\\.[a-zA-Z0-9()]{1,6}\\\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)"
grep-url = grep --heading -oE "\\\\w+://[^.]+.([-a-zA-Z0-9@:%_\\+.~#?&//=]*)"
grep-var = grep --heading -owIE "\\\\$[^(){}<>:;\\ ]+"
grep-wif = grep --heading -owE "[59KLc][1-9A-HJ-NP-Za-km-z]{50,51}"
grep-word = grep --heading -owEI -e "\\\\w{3,}" --or -e "[\\\\\\'’_a-zA-Z-]{2,}\\\\w"
grep-words = grep --heading -owEI -e "\\\\w{3,30}(\\\\s{1,3}\\\\w{2,30}){2,20}" --or -e "\\\\w{3,30}(\\\\W{1,3}\\\\w{2,30}){2,20}"
grep-words-sep = grep --heading -owEIP "\\\\w+(,.-\\\\w+)+"
f = fetch
fe = fetch
fg = fetch github
fo = fetch origin
fom = fetch origin master
fommom = !git fetch origin master && git merge origin/master
fetch-all = !"GIT_TERMINAL_PROMPT=0 find . -name .git -type d -print -execdir git fetch --all \\;"
exclude = !echo >> .git/info/exclude
l = log
ls-unmerged = diff --name-only --diff-filter=U --relative
log-graph = log --oneline --graph --decorate --all
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ma = merge --abort
majonez = !echo Hellmanns
mom = merge origin/master
out = !git log --boundary $(git rev-list --max-count=1 --simplify-by-decoration HEAD^)..
p = pull
pg = pull github
po = pull origin
pom = pull origin master
pull-all = !"GIT_TERMINAL_PROMPT=0 find . -name .git -type d -print -execdir git pull origin \\;"
pull-forks = "!git submodule foreach 'git pull `git config --get remote.origin.url | sed s#EXAMPLE#kenorb#`&'"
rb = rebase
rba = rebase --abort
reset-all = !"find . -name .git -type d -print -execdir git reset HEAD --hard \\;"
reset-author = "commit --amend --reset-author --no-edit"
reset-fetch = !"find . -name .git -type d -print -execdir git reset FETCH_HEAD \\;"
s = status
st = status
sm-clean-all = "submodule foreach --recursive 'git clean -fXd'"
sm-diff = "submodule foreach 'git diff'"
smu = submodule update
svn-dcommit = "!set -o xtrace; git stash; git svn dcommit; git stash pop -q"
unmerged = branch --no-merged
unmerged-all = branch --all --no-merged
update-all = "!cd $(git rev-parse --show-toplevel 2> /dev/null) && find -name .git -type d -execdir git pull -v ';'"
; branch-svn2git = !git for-each-ref refs/remotes --shell --format="r=%(refname:short) t=\${r#tags/}" | while read e; do eval "$e"; git branch -f $t refs/remotes/$r; git branch -d -r $r; done
; tag-svn2git = !git for-each-ref refs/remotes/tags --shell --format="r=%(refname:short) t=\${r#tags/}" | while read e; do eval "$e"; git tag -f $t refs/remotes/$r; git branch -d -r $r; done
# set -o xtrace; git stash; git svn dcommit; git stash pop -q"
# $(git rev-parse --show-toplevel 2> /dev/null)
; HOW TO
; How to change the author of past commits in git? See: http://stackoverflow.com/questions/750172/how-do-i-change-the-author-of-a-commit-in-git
; git filter-branch -f --env-filter 'if [ $GIT_AUTHOR_EMAIL = old@email ]; then GIT_AUTHOR_EMAIL='new@email'; GIT_COMMITTER_EMAIL='new@email'; fi; export GIT_AUTHOR_EMAIL; export GIT_COMMITTER_EMAIL;'
; git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='newemail'; GIT_COMMITTER_NAME='Oldname'; GIT_COMMITTER_EMAIL='oldemail';" HEAD
[clangFormat]
extension = cpp,c,hpp,h,mq4,mq5,mqh
style = file
[hooks.clangformat]
verbose = ON
[init]
defaultBranch = master