-
Notifications
You must be signed in to change notification settings - Fork 8
/
dot_gitconfig.tmpl
223 lines (222 loc) · 5.36 KB
/
dot_gitconfig.tmpl
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
[advice]
statusHints = true
pushNonFastForward = false
[alias]
## Spellings
ad = add
ass = add
dff = diff
doff = diff
emrge = merge
idff = diff
mergfe = merge
mregetool = mergetool
oull = pull
pish = push
pl = pull
ps = push
psuh = push
pu = up
puhs = push
puosh = push
pus = push
pushy = push
reabse = rebase
satsh = stash
sst = status -sb
t = status -sb
tint = init
tpull = pull
tpush = push
ts = status -sb
tst = status -sb
tup = up
fu = push --force-with-lease -u
## Shortcuts
st = status -sb
s = status -sb
b = branch -v
ci = commit --no-verbose
cia = commit --no-verbose --all
co = checkout
ch = change-branch
cob = checkout -b
cp = cherry-pick
l = log
a = add
d = diff
aa = add --all
aap = add --all -p
au = add -u
aua = add -u .
ap = add -p
pr = pull-request
tome = pull
toyou = push
cl = clone
vi = commit
via = commit --all
vin = commit --no-verify
viaa = commit --all --amend
sui = submodule update --init
cot = checkout -t
dc = diff --cached
standup = log --since yesterday --oneline --author caius
dm = "!git diff | mate"
dcm = "!git diff --cached | mate"
x = "!gitx"
git = "!exec git"
gtfu = "!echo GET THE FUCK UP"
proj = "!proj"
nyan = "!nyancat 2> /dev/null || echo gem install nyancat"
# purge-merged = "git b -d `git b --merged | awk \"/^ / { print $1 }\" | xargs` || echo 'No branches to delete'\"
# From http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
g = grep --break --heading --line-number
# TODO: extract into separate tool / take argument for branch to diff against?
show-missing-newlines-in-branch = "!git diff master | awk '/\\+\\+\\+/ { gsub(/w\\//, \"\", $2); last_filename = $2 }; /No newline at end of file/ { print last_filename }'"
fix-missing-newlines-in-branch = "!for file in $(git show-missing-newlines-in-branch); do echo >> $file; done"
sha = rev-parse HEAD
u = up
up = pull
praise = blame
stup = up
stas = stash
uip = up
iup = up
tpull-request = pull-request
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
tpr = !git pr
it = !git init && git commit -m "First!!!111oneone" --allow-empty
pre = pr
upsh = push
poush = push
add-p = add -p
# Pinched from https://github.com/speric/dotfiles/blob/master/gitconfig
short-recent = "for-each-ref --count=25 --sort=-committerdate refs/heads/ --format='%(refname:short)'"
stt = status -sb
cleanup-branches = "!git branch-cleanup"
base-branch = "!git rev-parse --symbolic-full-name refs/remotes/origin/HEAD | awk -F/ '{ print $4 }'"
home = "!git checkout $(git base-branch)"
# https://carolynvanslyck.com/blog/2020/12/git-wip/
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
[branch]
autosetupmerge = true
autosetuprebase = always
sort = authordate
[checkout]
defaultRemote = origin
[color]
branch = auto
diff = auto
status = auto
ui = true
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red italic
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[commit]
verbose = true
template = {{ .chezmoi.homeDir }}/.git_commit_template.txt
[core]
whitespace = fix,-indent-with-non-tab,trailing-space
excludesfile = {{ .chezmoi.homeDir }}/.gitignore
preloadindex = true
attributesfile = {{ .chezmoi.homeDir }}/.gitattributes
[credential]
helper = osxkeychain
[diff]
renamelimit = 0
mnemonicprefix = true
renames = copies
algorithm = patience
submodule = log
compactionHeuristic = true
[diff "doc"]
textconv = strings
[diff "exif"]
textconv = exiftool
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[fsck]
zeroPaddedFilemode = ignore
[grep]
extendRegexp = true
lineNumber = true
[help]
autocorrect = 0
[http]
sslverify = true
[hub]
protocol = https
[include]
path = {{ .chezmoi.homeDir }}/.netlify/helper/git-config
[init]
defaultBranch = main
[merge]
tool = mergemate
stat = true
ff = false
[mergetool]
keepBackup = false
[mergetool "mergemate"]
cmd = mate -wl1 \"$MERGED\"
trustExitCode = false
[protocol]
version = 2
[pull]
rebase = true
[push]
default = current
[rebase]
autoStash = true
[rerere]
enabled = true
[reset]
quiet = true
[status]
showUntrackedFiles = all
submoduleSummary = true
[submodule]
fetchJobs = 4
[url "git://gist.github.com/"]
insteadOf = gist:
[url "git://github.com/"]
insteadOf = github:
[url "[email protected]:"]
insteadOf = bb:
pushInsteadOf = bitbucket:
pushInsteadOf = git://bitbucket.org/
[url "[email protected]:"]
insteadOf = gst:
pushInsteadOf = gist:
pushInsteadOf = git://gist.github.com/
[url "[email protected]:"]
insteadOf = gh:
pushInsteadOf = github:
pushInsteadOf = git://github.com/
[url "[email protected]:"]
insteadOf = gl:
pushInsteadOf = gitlab:
pushInsteadOf = git://gitlab.com/
[user]
name = Caius Durling
email = {{ .email }}
useconfigonly = true