-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgitconfig
More file actions
205 lines (205 loc) · 4.88 KB
/
gitconfig
File metadata and controls
205 lines (205 loc) · 4.88 KB
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
[user]
name = Tim Hockin
email = thockin@google.com
[include]
path = ~/.gitconfig.local
[alias]
co = checkout
ci = commit
st = status
br = branch
revert = checkout --
amend = commit --amend
ama = commit --amend -a
curbr = "!f() { \
if [ ! -f .git/rebase-merge/head-name ]; then \
git rev-parse --abbrev-ref HEAD; \
else \
echo -n \"rb($(basename \"$(cat .git/rebase-merge/head-name)\")\"; \
if [ -f .git/rebase-merge/stopped-sha ]; then \
echo -n ',stopped'; \
fi; \
if (( $(git diff --name-only --diff-filter=U --relative | wc -l) != 0 )); then \
echo -n ',conflict'; \
fi; \
echo ')'; \
fi; \
}; f"
root = rev-parse --show-toplevel
set-upstream = remote set-head upstream
reset-upstream = remote set-head upstream --auto
head = "!f() { \
if [ -z \"$1\" ]; then \
echo 'error: no remote specified' >&2; \
return 1; \
fi; \
git symbolic-ref refs/remotes/$1/HEAD; \
}; f"
mbr = "!f() { \
if ! git head upstream >/dev/null 2>&1; then \
git reset-upstream; \
fi; \
set -o pipefail; \
git head upstream | cut -f4 -d/; \
}; f"
fup = fetch upstream
rb = rebase
rbup = "!f() { \
echo \"Rebasing onto $(git mbr)\"; \
git rebase upstream/$(git mbr) \"$@\"; \
}; f"
po = push origin
pocur = !git po $(git curbr)
pofcur = !git po -f $(git curbr)
wdiff = diff --color-words
safebr = "!f() { git co master || git co main; }; f"
track = "!f() { \
if [ -z \"$1\" ]; then \
echo 'error: no remote or branch specified' >&2; \
return 1; \
fi; \
rmt=upstream; \
br=$1; \
if [ -n \"$2\" ]; then \
rmt=$1; \
br=$2; \
fi; \
git fetch $rmt $br && git co -b $br $rmt/$br; \
}; f"
retrack = "!f() { \
if [ -z \"$1\" ]; then \
echo 'error: no remote or branch specified' >&2; \
return 1; \
fi; \
rmt=upstream; \
br=$1; \
if [ -n \"$2\" ]; then \
rmt=$1; \
br=$2; \
fi; \
git safebr; \
if [ -n \"$(git br -l $br)\" ]; then \
git br -D $br || return 1; \
fi; \
git track $rmt $br; \
}; f"
copr = "!f() { \
if [ -z \"$1\" ]; then \
echo 'error: no remote or PR specified' >&2; \
return 1; \
fi; \
rmt=upstream; \
pr=$1; \
if [ -n \"$2\" ]; then \
rmt=$1; \
pr=$2; \
fi; \
git fetch $rmt pull/$pr/head:pr-$rmt-$pr; \
git co pr-$rmt-$pr; \
}; f"
recopr = "!f() { \
if [ -z \"$1\" ]; then \
echo 'error: no remote or PR specified' >&2; \
return 1; \
fi; \
rmt=upstream; \
pr=$1; \
if [ -n \"$2\" ]; then \
rmt=$1; \
pr=$2; \
fi; \
git safebr; \
git br -D pr-$rmt-$pr; \
git copr $rmt $pr; \
}; f"
wip = for-each-ref --sort='committerdate:iso8601' --format=' %(color:green)%(committerdate:relative)%09%(color:white)%(refname:short)' refs/heads
my = "!f() { \
git log --reverse --no-show-signature --format='format:%C(auto)%h %s' upstream/$(git mbr)..HEAD; echo; \
}; f"
vs = "!f() { \
up=$1; \
test -z \"$1\" && up=upstream/$(git mbr); \
echo $up; \
git log --reverse --no-show-signature --format='format:%C(auto)%h %s' ${up}..HEAD; echo; \
}; f"
unstage = restore --staged
kys = "!f() { \
curbr=$(git curbr); \
echo \"Nuking $curbr\"; \
sleep 3; \
git safebr && git br -D $curbr; \
}; f"
[core]
editor = "vim +0"
excludesFile = ~/.gitignore
pager = diff-so-fancy | less --tabs=4 -RF
[merge]
conflictstyle = zdiff3
renamelimit = 4096
[push]
default = current
autoSetupRemote = true
[diff]
algorithm = histogram
srcPrefix = ""
dstPrefix = ""
#colorMoved = default
#colorMovedWS = ignore-space-change
[http "https://gopkg.in"]
followRedirects = true
[advice]
detachedHead = false
skippedCherryPicks = false
[rerere]
enabled = false
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = /home/thockin/.ssh/allowed_signers
[commit]
gpgsign = true
[tag]
gpgsign = true
sort = -version:refname
[pull]
rebase = true
[log]
showSignature = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[init]
defaultBranch = main
[url "git@github.com:"]
insteadOf = "gh://"
[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckObjects = true
[interactive]
diffFilter = diff-so-fancy --patch
[diff-so-fancy]
markEmptyLines = false
changeHunkIndicators = false
stripLeadingSymbols = false
#rulerWidth = 80
useUnicodeRuler = false
[color]
ui = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = 11
frag = magenta bold
func = 146 bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse