-
Notifications
You must be signed in to change notification settings - Fork 7
/
gitconfig
executable file
·476 lines (411 loc) · 12.3 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# Copyright (c) 2016-2017 Arctic Ice Studio <[email protected]>
# Copyright (c) 2016-2017 Sven Greb <[email protected]>
# Project: igloo
# Repository: https://github.com/arcticicestudio/igloo
# License: MIT
# References:
# https://git-scm.com/docs/git-config
# https://git-scm.com/book/tr/v2/Customizing-Git-Git-Configuration#_colors_in_git
# https://git-scm.com/docs/git-config#_conditional_includes
# https://github.com/so-fancy/diff-so-fancy#options
[includeIf "gitdir:~/yggdrasil/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/bitbucket/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/bitfroest/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/github/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/github/repositories/communicode/"]
path = ~/.gitconfig-auth-svengreb
[includeIf "gitdir:~/code/gitlab/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/incubator/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/.igloo/"]
path = ~/.gitconfig-auth
[includeIf "gitdir:~/code/job/"]
path = ~/.gitconfig-auth-job
[core]
repositoryFormatVersion = 0
filemode = true
bare = false
logallrefupdates = true
whitespace = tab-in-indent
editor = vim
pager = diff-so-fancy | less --tabs=4 -RFX
attributesfile = ~/.gitattributes
excludesfile = ~/.gitignore
autocrlf = input
[commit]
template = ~/.git-commit-msg
status = false
[diff]
tool = intellij
compactionHeuristic = true
[difftool "intellij"]
prompt = true
cmd = idea diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
[diff-so-fancy]
markEmptyLines = true
changeHunkIndicators = true
stripLeadingSymbols = true
useUnicodeRuler = true
[interactive]
diffFilter = diff-so-fancy
[merge]
tool = intellij
ff = false
[mergetool "intellij"]
keepBackup = false
prompt = false
trustExitCode = true
cmd = idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
[push]
default = current
[advice]
pushNonFastForward = false
statusHints = false
resolveConflict = false
[status]
showUntrackedFiles = all
[color]
branch = always
diff = always
grep = always
pager = true
showbranch = always
status = always
ui = always
[color "branch"]
current = "white blue bold"
local = "white bold"
plain = "white"
remote = "blue bold"
[color "decorate"]
branch = "blue bold"
HEAD = "white bold ul"
remoteBranch = "blue"
stash = "yellow"
tag = "cyan bold"
[color "diff"]
commit = "blue bold"
frag = "blue bold"
func = "white"
meta = "cyan"
new = "green"
old = "red"
plain = "white"
whitespace = "white reverse"
[color "diff-highlight"]
oldNormal = "red bold"
oldHighlight = "white red bold"
newNormal = "green bold"
newHighlight = "white green bold"
[color "grep"]
context = "white"
filename = "white dim ul"
function = "white"
linenumber = "white dim bold"
match = "blue bold"
selected = "white"
separator = "white dim"
[color "interactive"]
error = "red bold"
header = "blue bold"
help = "white dim"
prompt = "cyan"
[color "status"]
added = "green bold"
changed = "yellow bold"
header = "white ul"
nobranch = "magenta bold ul"
unmerged = "blue ul"
untracked = "red bold"
updated = "cyan bold"
[gui]
commitmsgwidth = 72
[alias]
#+----------------------+
#+ Interaction - Branch +
#+----------------------+
# Deletes all local branches based on the the specified gitflow branch prefix.
#
# Usage:
# git bclean <BRANCH>
bclean = "!f() { git for-each-ref refs/heads/$1/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -d $branch ; done }; f"
# Checks out into the specified branch.
# Shortended checkout command.
#
# Usage:
# git co <BRANCH>
co = checkout
# Checks out into a new tracking branch using the specified name.
#
# Usage:
# git cob <BRANCH>
cob = checkout -t -b
# GitHub Pull Request Management
# Creates a branch based on the specified GitHub Pull Request ID.
# Default remote "origin" is used unless otherwise stated.
#
# Usage:
# git pr <GITHUB_PULL_REQUEST_ID> [REMOTE]
# Examples:
# "git pr 4" Creates a local branch "pr/4" from the default "origin" remote
# "git pr 4 remote" Creates a local branch "pr/4" from the specified remote "remote"
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# GitHub Pull Request Management
# Deletes all branches based on the specified GitHub Pull Request ID.
# Default remote "origin" is used unless otherwise stated.
#
# Usage:
# git pr-clean
# Examples:
# "git pr-clean" Removes all branches in "pr/*" from the local repository
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -d $branch ; done"
# +----------------------+
# + Interaction - Commit +
# +----------------------+
# Adds all specified files to the stage and prints the status.
#
# Depends on:
# alias.s
# Usage:
# git a <FILES>
a = ! sh -c 'git add -- "$@" && git s' --
# Adds all specified files interactively in patch mode to the stage and prints the status.
#
# Depends on:
# alias.s
# Usage:
# git ap <FILES>
ap = ! git add -p $@ && git s
# Adds all unstaged- and untracked files to the stage and prints the status.
#
# Depends on:
# alias.s
# Usage:
# git aa
aa = ! git add . && git s
# Commits all staged files.
# Shortended commit command.
#
# Usage:
# git c
c = commit
# +---------------------+
# + Interaction - Fetch +
# +---------------------+
# Fetches changes from all remotes and removes any remote-tracking references that no longer exists.
#
# Usage:
# git fa
fa = fetch --all --prune
# +----------------------------+
# + Interaction - Format Patch +
# +----------------------------+
# Formats "diff-so-fancy" compatible patchs by removing printed ANSI color escape sequences and enables patch stats
# by default.
#
# Usage:
# git fp
fp = diff --patch-with-stat --no-color
# +---------------------+
# + Interaction - Merge +
# +---------------------+
# Merges the specified branch in non-fast-forward mode.
#
# Usage:
# git m <BRANCH>
m = merge --no-ff
# +--------------------+
# + Interaction - Pull +
# +--------------------+
# Pulls changes from the specified remote in non-fast-forward mode and prunes all unreachable objects from the object
# database.
#
# Usage:
# git pl <REMOTE>
pl = ! git pull --no-ff --prune $@
# Pulls changes from the specified remote in non-fast-forward mode, performs a rebase and prunes all unreachable
# objects from the object database.
# !WARNING!
# Use rebasing with caution and only for local and unpushed branches!
# History that got rewritten in a shared branch touched by multiple developers may break the repository!
# Rebasing a shared branch that others have based work on may lead to problems by forcing other users to manually
# fix their history.
#
# Usage:
# git plrb <REMOTE>
# References:
# https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase
plrb = ! git pull --no-ff --rebase --prune $@
# Pulls changes from the specified remote in fast-forward mode and prunes all unreachable objects from the object
# database.
# !WARNING!
# Use fast-forward mode with caution to prevent loss of "commit <> branch" tracking information in the history!
#
# Usage:
# git plff <REMOTE>
plff = ! git pull --ff-only --prune $@
# Pulls changes from the specified remote in fast-forward mode, performs a rebase and prunes all unreachable objects
# from the object database.
# !WARNING!
# Use fast-forward mode with caution to prevent loss of "commit <> branch" tracking information in the history!
# !WARNING!
# Use rebasing with caution and only for local and unpushed branches!
# History that got rewritten in a shared branch touched by multiple developers may break the repository!
# Rebasing a shared branch that others have based work on may lead to problems by forcing other users to manually
# fix their history.
#
# Usage:
# git plffrb <REMOTE>
# References:
# https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase
plffrb = ! git pull --rebase --ff-only --prune $@
# +--------------------+
# + Interaction - Push +
# +--------------------+
# Pushes the current branch to the default "origin" remote.
#
# Usage:
# git po
po = push origin
# +---------------------+
# + Interaction - Reset +
# +---------------------+
# Resets to the specific commit.
# Updates the index and does not touch the working tree.
# Shortended reset command.
#
# Usage:
# git back <SHA1>
back = reset
# Undoes the last commit.
#
# Usage:
# git undo
undo = reset HEAD~1 --mixed
# Resets the stage.
#
# Usage:
# git unstage
unstage = reset HEAD --
# Hardresets to the specific commit.
# Shortended reset command.
# !WARNING!
# Any changes to tracked files in the working tree commited after the specified commit are discarded!
# This will reset the index and the working tree.
#
# Usage:
# git wipe <SHA1>
wipe = reset --hard
# +----------------------+
# + Information - Branch +
# +----------------------+
# Prints all branches with abbreviated SHA1 checksum and commit message.
#
# Usage:
# git b
b = branch --all
# Prints only branches that have not been merged yet into the specified branch.
# If no BRANCH is specified, the current branch is used by default.
#
# Usage:
# git bum [BRANCH]
bum = branch --all --no-merged
# Prints only branches that have been merged into the specified branch.
# If no BRANCH is specified, the current branch is used by default.
#
# Usage:
# git bm [BRANCH]
bm = branch --all --merged
# +-------------------+
# + Information - Log +
# +-------------------+
# Prints a prettified commit log.
#
# Usage:
# git l
# Output Format:
# <ABBREVIATED_SHA1> <COMMIT_MESSAGE> <REFS>
l = log --graph --pretty=format:'%C(cyan)%h %C(white)%s %C(cyan bold)%d'
# Prints a prettified flat commit log without topic commits from merges.
#
# Depends on:
# alias.l
# Usage:
# git lf
lf = ! git l --first-parent
# Prints a extended and prettified commit log graph.
#
# Usage:
# git ll
# Output Format:
# <COMMIT_SHA1> [REFS]
# <AUTHOR_NAME> <AUTHOR_EMAIL>
# <COMMIT_ISO_8601_DATE> (<RELATIVE_COMMIT_DATE>)
# <COMMIT_MESSAGE>
ll = log --graph --pretty=format:'%C(cyan ul)%H%C(reset) %C(cyan bold)%d\n%C(blue bold)%an %C(black)<%C(blue)%ae%C(black)>\n%C(black bold)%ci (%C(black bold)%cr)\n%C(white)%B'
# Prints a prettified flat commit log graph without topic commits from merges.
#
# Depends on:
# alias.ll
# Usage:
# git llf
llf = ! git ll --first-parent
# Lists the log for all commits commited after the given tag or SHA1.
#
# Depends on:
# alias.l
# Usage:
# git lch <TAG>|<SHA1>
lch = ! git l $1..HEAD
# Lists all new commits after the fetch including stats.
#
# Depends on:
# alias.l
# Usage:
# git lnew
lnew = ! git l ORIG_HEAD.. --stat
# +----------------------+
# + Information - Status +
# +----------------------+
# Shows the status.
# Shortended status command.
#
# Usage:
# git s
s = status
# +-------------------+
# + Information - Tag +
# +-------------------+
# Lists all tags handled as version strings in sorted order.
#
# Usage:
# git t
t = tag --list --sort=version:refname
# Creates a signed annotated tag.
#
# Usage:
# git ts <TAG>
ts = tag --annotate --sign
# +----------------+
# + Query - Branch +
# +----------------+
# Finds all branches containing the given SHA1 checksum.
#
# Depends on:
# alias.b
# Usage:
# git fb <SHA1>
fb = ! sh -c 'git branch --contains $1' --
# +-------------+
# + Query - Tag +
# +-------------+
# Finds all tags containing the given SHA1 checksum.
#
# Usage:
# git ft <SHA1>
ft = ! git describe --tags --contains $1