-
Notifications
You must be signed in to change notification settings - Fork 4
/
gitconfig
157 lines (137 loc) · 4.71 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
[user] # {{{
name = Sun Wuan
email = *********************
[core]
packedGitLimit = 512m
packedGitWindowSize = 512m
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
quotepath = false
[pack]
deltaCacheSize = 2047m
packSizeLimit = 2047m
windowMemory = 2047m
[format]
headers = ""
subjectprefix = ""
[diff]
tool = vimdiff
renameLimit = 0
[diff "jp"]
textconv = nkf -w
cachetextconv = true
[diff "msword"] # http://progit.org/book/zh/ch7-2.html
textconv = antiword -w0
cachetextconv = true
[diff "msexcel"]
textconv = xlhtml -fw -asc -te -xp:0-10 -xc:0-100
cachetextconv = true
[diff "ansible-vault"]
textconv = ansible-vault view
cachetextconv = true
[difftool "normal"] # http://goo.gl/c8Xok
cmd = diff $LOCAL $REMOTE
[difftool "vimdiff"] # https://github.com/neovim/neovim/issues/2377
cmd = vim -d $LOCAL $REMOTE
[difftool]
prompt = false
[push]
default = current
[gui]
fontdiff = -family \"Andale Mono\" -size 10 -weight normal -slant roman -underline 0 -overstrike 0
# }}}
[tig] # {{{
line-graphics = no
tab-size = 4
[tig "color"]
default = default default
date = green default
author = default default
cursor = white blue
title-blur = black white
title-focus = black white bold
[tig "bind"]
generic = i view-close
diff = , previous
diff = . next
stage = , previous
stage = . next
# }}}
[color] #{{{
status = auto
diff = auto
branch = auto
interactive = auto
[color "diff"]
frag = magenta
#}}}
[branch "master"] # {{{
remote = origin
merge = refs/heads/master
# }}}
[merge] # {{{
tool = persistent
[mergetool "persistent"]
# ref Brian Phillips @http://stackoverflow.com/questions/585844/merging-with-git-mergetool
cmd = "vim -d \"$PWD/$MERGED\" \
+\":split $PWD/$REMOTE\" +\":set buftype=nowrite\" \
+\":vertical diffsplit $PWD/$LOCAL\" +\":set buftype=nowrite\" \
+\":vertical diffsplit $PWD/$BASE\" +\":set buftype=nowrite\" \
+\":wincmd j\" \
+\":nmap <ESC>1 :diffget BASE<CR>:diffupdate<CR>\" \
+\":nmap <ESC>2 :diffget LOCAL<CR>:diffupdate<CR>\" \
+\":nmap <ESC>3 :diffget REMOTE<CR>:diffupdate<CR>\" "
#}}}
[alias] # {{{
ci = commit
ce = commit --allow-empty
cm = commit --amend
co = checkout
cd = checkout -b
cpk = cherry-pick --no-commit # 复制一个 commit 所做的修改
cpp = revert --no-commit # 撤销一个 commit 所做的修改
coo = reset HEAD -- # 撤消已提交到 local repos 的修改
br = branch
di = diff --ignore-submodules=dirty --no-prefix -p --stat # show difference between working tree and the index
dc = diff --ignore-submodules=dirty --no-prefix -p --stat --cached # show difference between index and local repos, what would be committed with "git commit"
da = diff --ignore-submodules=dirty --no-prefix -p --stat HEAD # show difference between working tree and local repos, what would be committed with "git commit -a"
df = diff --ignore-submodules=dirty --no-prefix --stat=200,78 # show different files between working tree and the index
dt = difftool -y
do = difftool -y -t normal
dp = !sh -c 'git diff HEAD "$0" | git apply --whitespace=nowarn --index -' # fast apply the patch against "$0" commit or branch
fp = format-patch -s
ll = log --pretty=format:'%C(blue)%h%Creset %cn %m %s %C(green)%C(dim)%cr%Creset %C(bold)%d%Creset' --branches --graph --since='2 weeks ago'
ls = log --pretty=format:'%C(blue)%h%Creset %cn %m %s %C(green)%C(dim)%ci%Creset %C(bold)%d%Creset' --all --graph
lf = log --pretty=format:'%C(blue)%h%Creset %cn %m %s %C(green)%C(dim)%ci%Creset %C(bold)%d%Creset' --stat
ms = merge --squash
mf = merge --no-ff # generate a merge commit even if the merge resolved as a fast-forward
mt = mergetool
ppa = !sh -c 'git fetch origin merge-requests/$1/head:ppa/$1 && git di HEAD ppa/$1' - # conflict with git-extra(git-mr)
ppr = !sh -c 'git fetch origin pull/$1/head:ppr/$1 && git di HEAD ppr/$1' -
# 核弹级选项: filter-branch
# http://progit.org/book/zh/ch6-4.html
nc = filter-branch -f --tree-filter
st = status -s --ignore-submodules=dirty
sma = submodule add
smi = submodule init
smu = submodule update
sms = submodule status
smy = submodule sync
zc = stash save
zl = stash list
zo = stash pop
zd = stash drop
dci = svn dcommit
dco = svn clone -r HEAD
dca = svn clone
dup = svn rebase
dll = svn log --oneline --limit=20
dls = svn log
vi = difftool
# }}}
[pull] # {{{
ff = only
# }}}
#[http]
# proxy = http://10.167.251.83:8080
# vim: set foldmethod=marker: