-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
748 lines (635 loc) · 25.5 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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
[user]
name =
email =
[core]
editor = vim
fileMode = false
bare = false
logallrefupdates = true
whitespace = tab-in-indent, trailing-space
excludesfile = ~/.gitignore
# autocrlf [false, input, true]
autocrlf = input
# lf, crlf and native
# eol = native
# To speed up over NFS
preloadindex = true
pager = less -F -X
[push]
default = simple
[gc]
auto = 1
# template
# <Alias name> = "! \
# set -e; \
# set -u; \
# f() { \
# }; \
# f"
[alias]
tg = tag -l
ci = commit
cim = !git ci -m
ci-msg = commit --allow-empty -m
credit = blame
# Diff commands
# =============
d-chk = diff --check # Check for errors combined with core.whitespace (space, tab ... )
d-ch = diff --cached --histogram
d-cnp = !git --no-pager d-ch # Show cached diff without using a pager
d-sh = diff --staged --histogram
d-h = diff --histogram
dfnp = !git --no-pager diff # Shows the diff without using a pager
y = diff "@{yesterday}"
# Using external tools
dftool= difftool # Default tool
dfp4 = difftool --tool=p4merge # launch diff with p4merge
dfvim = difftool --tool=vimdiff # launch diff with vimdiff
mtool-meld = mergetool --tool=meld
#
w = whatchanged
# Word diff
d-w = diff --word-diff # Shows the diff only showing the changed words
d-w-plain = diff --word-diff=plain
d-w-plus = diff --word-diff --word-diff-regex='\\w+'
d-w-nbreaks = !git diff --word-diff-regex=[^[:space:]] # Show the diff ignoring white space or new lines
# Status commands
st = status -sb
st-all = status -sb -uall
st-u = diff --name-status --diff-filter=U
st-uno = status -uno
# Remove files from the repository, but not from my current directory
rmc = rm --cached
# Adding files
# ==================================================================
track = add -N
added = add -e
addp = add -p
# Add new files to the index without adding the content
adding = add --intent-to-add
# Removing files from history
# ==================================================================
rm-from-all-history = "! \
set -e; \
set -u; \
f() { \
git filter-branch --prune-empty -d /dev/shm/tmp --index-filter \"git rm --force --cached --ignore-unmatch '$1'\" -- --all; \
`# clear any trace` \
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin \
git reflog expire --expire=now --all \
git gc --prune=now \
}; \
f"
# Spunoff directory as project with all its changes
# git filter-branch --subdirectory-filter foodir -- --all
# Runing gitk with git
k = !gitk
ka = !gitk --all
kme = !gitk --all --author=$(git config user.email)
cp = cherry-pick -x
# Branching
# ==================================================================
# todo:
# get current remote name, likely "origin"
# remote-name=$(git remote)
# get current branch name
# push the current branch to the remote
# git push --set-upstream ${remote-name} ${git currentbranch}
push-this = "! \
set -e; \
set -u; \
f() { \
remote_name=\"$(git remote)\"; \
echo \"Pushing $(tput bold)$(git currentbranch)$(tput sgr0) branch to $(tput bold)$remote_name$(tput sgr0) remote\"; \
git push -u \"${remote_name}\" HEAD; \
}; f"
# git push -u \"${remote-name}\" HEAD \
# git push -u origin HEAD
# echo \"git push --set-upstream \"${remote-name}\" $(git currentbranch) \"; \
# Git 2.22 and above
# git branch --show-current
currentbranch = "rev-parse --abbrev-ref HEAD"
co = checkout # git co <branch>
co-re = !git checkout -b "$(basename $1)"
# Find commit in branches
find-commit-in-branches = branch -a --contains
## Create a new branch and switch to it ex.: git nb <branch>
## Create a new branch based on other and switch to it ex.: git nb <branch> <based branch>
nb = checkout -b
## Create a new branch without a parent
nb-orphan = checkout --orphan
# TODO: Check if there is any parameter passed to the function \
# Create a new branch and name it with a string that has spaces within
# Ex. ``git nbs "this is a test branch"`` will create ``this_is_a_test_branch`` based on the current branch
# Ex. ``git nbs "this is a test branch based on master" master`` will create ``this_is_a_test_branch_based_on_master``
# We're limiting branch names to 72 characters
nbs = "! \
set -e; \
set -u; \
f() { \
branchName=\"$( echo \\\"$1\\\" | sed 's/ - /-/g' | tr -cd '[:alnum:][:blank:]-_' | tr '[:blank:]' '_' | tr '[:upper:]' '[:lower:]' )\"; \
echo $branchName; \
echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
git checkout -b \"${branchName}\" ${2:-}; \
}; f"
# git checkout -b ${branch_name} \
nbs0 = "! \
set -e; \
set -u; \
f() { \
branchName=\"$( echo \\\"$1\\\" | sed 's/ - /-/g' | tr -cd '[:alnum:][:blank:]-_' | tr '[:blank:]' '_' | tr '[:upper:]' '[:lower:]' )\"; \
echo $branchName; \
}; f"
#echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
# git checkout -b ${branch_name} \
# Create a new branch from string and add the year and month
# git nbd 'this is the name of my branch' <from branch>
# nbd = "! \
# set -e; \
# set -u; \
# set -x; \
# f() { \
# date_y_m=\"$(date +%Y%m )\"; \
# git nbs \"$date_y_m $1\" ${2:-}; \
# }; f"
nbd = "!date_y_m=\"$(date +%Y%m )\"; git nbs \"$date_y_m $1\" ${2:-}; #"
nbd0 = "!date_y_m=\"$(date +%Y%m )\"; git nbs0 \"$date_y_m $1\" ${2:-}; #"
# New release branch
nb-release = "! \
set -e; \
set -u; \
f() { \
branchName=\"release/$( git nbd0 \"$1\" ${2:-}; )\"; \
echo $branchName; \
echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
git checkout -b \"${branchName}\" ${2:-}; \
}; f"
# New hotfix branch
nb-hotfix = "! \
set -e; \
set -u; \
f() { \
branchName=\"hotfix/$( git nbd0 \"$1\" ${2:-}; )\"; \
echo $branchName; \
echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
git checkout -b \"${branchName}\" ${2:-}; \
}; f"
# New bugfix branch
nb-bugfix = "! \
set -e; \
set -u; \
f() { \
branchName=\"bugfix/$( git nbd0 \"$1\" ${2:-}; )\"; \
echo $branchName; \
echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
git checkout -b \"${branchName}\" ${2:-}; \
}; f"
# New feature branch
nb-feature = "! \
set -e; \
set -u; \
f() { \
branchName=\"feature/$( git nbd0 \"$1\" ${2:-}; )\"; \
echo $branchName; \
echo 'git checkout -b \"${branchName::72}\" ${2:-}'; \
git checkout -b \"${branchName}\" ${2:-}; \
}; f"
debug = "!set -x; GIT_TRACE=2 GIT_CURL_VERBOSE=2 GIT_TRACE_PERFORMANCE=2 GIT_TRACE_PACK_ACCESS=2 GIT_TRACE_PACKET=2 GIT_TRACE_PACKFILE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 git"
# Quote / unquote a sh command, converting it to / from a git alias string
# https://stackoverflow.com/a/39616600/1476332
quote-string = "!read -r l; printf \\\"!; printf %s \"$l\" | sed 's/\\([\\\"]\\)/\\\\\\1/g'; printf \" #\\\"\\n\" #"
# quote-string-undo = "!read -r l; printf %s \"$l\" | sed 's/\\\\\\([\\\"]\\)/\\1/g'; printf \"\\n\" #"
# test alias
test = "! \
f() { \
echo \"Hello World!\"; \
}; f"
## Get information from the local branches
# branch = !git --no-pager branch # Using core.pager 'less -+F -+X' so less will not paginate less than a page
br = branch --verbose
br-c = branch --verbose --sort=-committerdate --format='%(authordate:short) %(color:red)%(objectname:short) %(HEAD)%(color:yellow)%(refname:short) %(color:magenta)%(authorname) %(color:bold green)(%(committerdate:relative))%(color:reset)' --color=always
bra = branch --all
bra-c = branch --all --sort=-committerdate --format='%(authordate:short) %(color:red)%(objectname:short) %(HEAD)%(color:yellow)%(refname:short) %(color:magenta)%(authorname) %(color:bold green)(%(committerdate:relative))%(color:reset)' --color=always
brr = branch --remotes
brr-c = branch --remotes --sort=-committerdate --format='%(authordate:short) %(color:red)%(objectname:short) %(HEAD)%(color:yellow)%(refname:short) %(color:magenta)%(authorname) %(color:bold green)(%(committerdate:relative))%(color:reset)' --color=always
br-merged = branch --merged # list merged branches
## Get information from the remote repositories
re = remote -v
lsbranch = !git for-each-ref --sort='authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads
lsbranch-asc = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads
lsrbranch = !git for-each-ref --sort='authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/remotes
lsrbranch-asc = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/remotes
lsstash = !git for-each-ref --sort='authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/stash
lsstash-asc = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/stash
# Branch commands
# ===============
# Remove remote branch if git is older than 1.7.0 we can do `git push origin :<branchName>`
#rmr = "!f() { git push origin :$1; }; f"
rmrbranch = push origin --delete
# Remove the current branch printing the branch commit
br-remove = branch -D
# Get the existing branches with extra info
br-info = "! git branch --no-abbrev --verbose"
# Search for any branch which include the word
# debug flags
#
get-branch = "!\
set -e; \
set -x; \
set -u; \
f() { \
result=\"$( git branch | grep \"$1\" | cut -c3-)\"; \
if [ ${result:-x} == \"x\" ]; then \
exit 1; \
else \
printf \"${result}\\n\"; \
fi \
}; f"
brsearchall = "! \
set -e; \
set -u; \
f() { \
BRANCH=$(git get-branch $1); \
if [ $( printf \"${BRANCH}\" | grep -cve '^\\s*$' ) -ge 1 ]; then \
echo \"${BRANCH}\"; \
else \
echo \"No branch match\"; \
exit 1; \
fi; \
}; f"
# Debug flags
#
# set -x; \
# set -e; \
brsearch = "! \
set -u; \
f() { \
BRANCH=$(git get-branch $1); \
if [ $? -ne 0 ]; then \
echo \"No branch match\"; \
exit 1; \
else \
match_count=$( printf \"${BRANCH}\" | grep -cve '^\\s*$' ); \
if [ ${match_count} -eq 1 ]; then \
echo \"${BRANCH}\"; \
else \
echo \"Multiple branches match\"; \
git brsearchall \"$1\"; \
exit 2; \
fi \
fi \
}; f"
##
# Function template
# Back slashes and semicolon have to be used because git makes one line of
# the function, omitting them will throw errors
##
# <git alias> = "! \
# set -e; \
# set -u; \
# f() { \
# # Bash
# }; f"
brsearchremotes = "! \
set -e; \
set -u; \
f() { \
BRANCH=$(git branch -r | grep \"$1\" | cut -c3-); \
if [ $? -ne 0 ]; then \
echo \"No branch match\"; \
exit 1; \
else \
match_count=$( printf \"${BRANCH}\" | grep -cve '^\\s*$' ); \
if [ ${match_count} -eq 1 ]; then \
echo \"${BRANCH}\"; \
else \
echo \"Multiple branches match\"; \
echo \"${BRANCH}\"; \
exit 2; \
fi \
fi \
}; f"
# checkout for a branch with a specific identifier
# Debug flags
# set -e; \
# set -x; \
cobr = "!\
set -u; \
f(){ \
BRANCH=$( git brsearch \"$1\" ); \
if [ $? -ne 0 ]; then \
printf \"${BRANCH}\\n\"; \
else \
git co \"${BRANCH}\"; \
fi \
}; f"
# checkout for a branch with a specific identifier
#cobr = "!_f(){ BRANCH=\"$(git brsearch \"$1\")\" || { echo \"$BRANCH\"; exit 1;}; git co \"$BRANCH\"; }; _f"
corbr = "!\
set -u; \
f(){ \
BRANCH=$( git brsearchremotes \"$1\" | grep -Poe '^[^/]+/\\K.*' ); \
printf \"${BRANCH}\\n\"; \
if [ $? -ne 0 ]; then \
printf \"${BRANCH}\\n\"; \
else \
git co \"${BRANCH}\"; \
fi \
}; f"
# Merge aliases
# =============
m-ne = merge --no-edit
m-ff = merge --ff-only
m-p = merge --strategy-option=patience
m-sq = merge --squash
# Pull and rebase
p-r = pull --rebase
##
# make Branch A resolve conflicts to branch b
# https://stackoverflow.com/questions/173919/is-there-a-theirs-version-of-git-merge-s-ours#answer-4969679
##
# TODO: make script
# # in case branchA is not our current branch
# git checkout branchA
# # make merge commit but without conflicts!!
# # the contents of 'ours' will be discarded later
# git merge -s ours branchB
# # make temporary branch to merged commit
# git branch branchTEMP
# # get contents of working tree and index to the one of branchB
# git reset --hard branchB
# # reset to our merged commit but
# # keep contents of working tree and index
# git reset --soft branchTEMP
# # change the contents of the merged commit
# # with the contents of branchB
# git commit --amend
# # get rid off our temporary branch
# git branch -D branchTEMP
# # verify that the merge commit contains only contents of branchB
# git diff HEAD branchB
# http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/#use_snapshot_stashes
snapshot = !git stash save --keep-index "snapshot: $(date)"
# snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
# http://stackoverflow.com/questions/1360712/git-stash-cannot-apply-to-a-dirty-working-tree-please-stage-your-changes#answer-3733698
unstash = !git stash show -p | git apply -3 && git stash drop
############################################################################
# Git find files in history
############################################################################
# https://stackoverflow.com/a/372970/1476332
find = log --all --
# Git find file in branch from author
# TODO: git log --grep='branch' --author='me' -- *.sql
# TODO: If you want to see where it's been deleted / created /etc, you can use git log --all --stat -- **/my_file.png
############################################################################
# END - Git find files in history
############################################################################
# Log commands
# ==================================================================
# Formating http://git-scm.com/docs/git-log
# Display the log including the commit content
lg = log -p
# Displays a nice list of commits of the current branch
lol = log --graph --decorate --date=relative --oneline
# Displays a nice list of commits of all the branches
lola = log --graph --decorate --date=relative --oneline --all
# Displays a nice list of commits of the current branch including time, author name and commiter name
lolc = log --graph --color --pretty=format:'%C(yellow)%h%Creset - %C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %ai %C(dim white)<%cn> %ci%Creset'
# Displays a nice list of commits of all the branches including time, author name and commiter name
lolac = log --graph --color --pretty=format:'%C(yellow)%h%Creset - %C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %ai %C(dim white)<%cn> %ci%Creset' --all
# Looks the same as lolc ... ????
lolf = log --graph --pretty=format:'%C(yellow)%h%Creset - %C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %ai %C(dim white)<%cn> %ci%Creset' --date=relative
# git log branch
lbrl = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)' refs/heads
lbra = !git for-each-ref --sort='-authordate:iso8601' --format=' %(authordate:relative)%09%(refname:short)'
# List branches tracking remote branches
br-tracking = "! \
set -e; \
set -u; \
f() { \
git for-each-ref --format='%(refname:short)' refs/heads/* | while read LOCALBRANCH; do \
if ORIGIN=$(git config --get branch.$LOCALBRANCH.remote); then \
REMOTEBRANCH=$(git config --get branch.$LOCALBRANCH.merge); \
echo \"$LOCALBRANCH -> $ORIGIN/${REMOTEBRANCH##*/}\"; \
fi; \
done; \
}; \
f"
# List branches not tracking remote branches
br-no-tracking = "! \
set -e; \
set -u; \
f() { \
git for-each-ref --format='%(refname:short)' refs/heads/* | while read LOCALBRANCH; do \
if ! [ $(git config --get branch.$LOCALBRANCH.remote) ]; then \
echo \"$LOCALBRANCH\"; \
fi; \
done; \
}; \
f"
# Interactively removes local branches that are not tracking any remote branch
prune-me = "! \
set -e; \
set -u; \
f() { \
git br-no-tracking | while read -r LINE; do \
printf \"\nDo you want to prune %s? [y/n]\n\" \"$LINE\"; \
read CONFIRM </dev/tty; \
case \"$CONFIRM\" in \
[yY]) \
printf \"\nPruning '%s' from local repository ...\n\" \"$LINE\"; \
git branch -D \"$LINE\" \
;; \
*) printf \"Skiping %s \n\n\" \"$LINE\" ;; \
esac; \
done; \
}; \
f"
# Show my commits only
log-me = !git lolc --author=\"$(git config user.email)\"
# Show commit information
cinfo = show --pretty=fuller --quiet
# Show information about files in the index
ls = ls-files
# Shows the commits comming from the remote before merging them into our branch
incomming = "!git remote update -p; git log ..@{u}"
# See them as a patch
incomming-p = "!git remote update -p; git log ..@{u} -p"
# Show what we will be pushing to the remote branch
outgoing = log @{u}..
# Ignoring files
# ==================================================================
## Show files ignored by git:
ign = ls-files -o -i --exclude-standard
## Ignoring files, undoing and listing
ignored = !git ls-files -v | grep "^[[:lower:]]"
# Ignore changes in a file, if a remote commit has changed the file
# it will overwrite the file without raise a warning
# Those are not stored in .gitignore
ignore = update-index --assume-unchanged
# Mark modified files as unchanged
ignore-modified = "!\
set -u; \
f(){ \
git ls-files --modified -z $* | xargs -0 -I{} git update-index --assume-unchanged {}; \
}; f"
# Stop ignoring changes in a file
unignore = update-index --no-assume-unchanged
# Add ignore rules to the .gitignore file
ignore-file = "!\
set -u; \
f(){ \
for i in $*; do \
echo $i >> .gitignore; \
done \
}; f"
# hide = update-index --assume-unchanged
# unhide = update-index --no-assume-unchanged
# unhide-all = update-index --really-refresh
# hidden = !git ls-files -v | grep \"^[a-z]\"
# ignored = !git status -s --ignored | grep \"^!!\"
# Amending the previous commit
# ==================================================================
## Amend the previous commit adding the files from index/cached to the previous commit
amend = commit --amend
## Add the files from the index/cached to the previous commit without changing our message
amendfile = commit --amend --no-edit
## add all the files in our work directory except the new ones to the previous commit
amendall = commit --amend --all
## Amend the commit message on the last commit
amend-last-msg = commit --amend -c HEAD
## Amend the commit message on a specific commit
amend-msg = commit --amend -c
## Amend the previous commit including the date
amend-msg-and-time = commit --amend --date=now
## Amend the previous commit author and time
amend-author-and-time = commit --amend --reset-author --no-edit
# Fetch commands
# ==============
# Get all the changes from the server but no merge any of the branches
fetchall = fetch --all
# Undo commands
# =============
## Remove the staged changes (This is opposite to git add)
unstage = reset HEAD
clearindex = reset HEAD
## Remove the last commit but keep the changes in the working directory
uncommit = reset --soft HEAD^
# Tools
# ==================================================================
killspace = !git stripspace <
killcomments = !git stripspace --strip-comments <
addcomments = !git stripspace --comment-lines <
# Utils
# ==================================================================
# Pack the repository and run, this can be used even on a not git repository
panic = !tar cvf ../git_panic.tar *
# Get the repository size
repo-size = !git count-objects -v --human-readable | grep -P -o '(?<=size: ).*'
# Git-doc: Commit everything as a new version
doc = !git add -A && git cim 'Doc: Updating'
wipe = "!git add -u && git cim \"WIP - $(git currentbranch)\""
wip = "!git add -A && git cim \"WIP - $(git currentbranch)\""
# Extras
# set -x; \
release = "!\
set -u; \
f(){ \
current_branch=$(git currentbranch); \
tag_name=\"release/$(date +%F)\"; \
echo ${tag_name}; \
git tag ${tag_name}; \
echo ${tag_name}; \
git push origin ${tag_name} ${current_branch}; \
}; f"
hotfix = "!\
set -u; \
f(){ \
current_branch=$(git currentbranch); \
tag_name=\"hotfix/$(date +%F)\"; \
git tag ${tag_name}; \
git push origin ${tag_name} ${current_branch}; \
}; f"
[color]
ui = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
# [merge]
# tool = meld
# summary = true
[diff]
algorithm = patience
[difftool]
prompt = false
[mergetool]
prompt = false
keepBackup = false
[commit]
template = ~/.gitmessage
[gui]
commitmsgwidth = 72
[difftool "meld"]
# [mergetool "vimdiff"]
# cmd = vimdiff "$LOCAL" "$BASE" "$REMOTE" "$MERGED"
# conflictstyle = diff3
# prompt = false
[difftool "vimdiff"]
cmd = vimdiff $LOCAL $REMOTE
#[mergetool "meld"]
# cmd = meld --diff $LOCAL $BASE $REMOTE --output $MERGED
# Using p4merge, because it let us diff images
# to call it we have to use git dfp4
[difftool "p4merge"]
# test expansion
cmd = ~/workspace/apps/p4v/bin/p4merge $LOCAL $REMOTE
# Allowing to just do `git push` to push the current branch to the configured upstream
[push]
default = upstream
# Remove empty directory from svn repo as they get removed from local git
[svn]
rmdir = true
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
##
# Useful filters
##
# Usage: add to your .gitattributes or .git/info/attributes
# *.php filter=spaces2tabs
# Repo in spaces, local using tabs
[filter "spaces2tabs"]
clean = expand --tabs=4 --initial
smudge = unexpand --tabs=4 --first-only
required = true
# Usage: add to your .gitattributes or .git/info/attributes
# *.php filter=tabs2spaces
# Repo in tabs, local using spaces
[filter "tabs2spaces"]
smudge = expand --tabs=4 --initial
clean = unexpand --tabs=4 --first-only
required = true
[merge]
renormalize = true
tool = vimdiff
conflictstyle = diff3
[pull]
ff = only