-
Notifications
You must be signed in to change notification settings - Fork 24
/
.gitconfig
97 lines (77 loc) · 3.42 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
[include]
path = ~/.gitconfig.local
[core]
# Use a global .gitignore file.
excludesfile = ~/.gitignore
# Enable parallel I/O for operations like "git diff".
# See http://stackoverflow.com/q/18257622/276478
preloadindex = true
# Use 12 characters for the abbreviated commit hash. I can currently make
# do with 10, but this should provide a certain level of safety for the
# near-ish future. See the interesting and well-researched article at
# http://blog.cuviper.com/2013/11/10/how-short-can-git-abbreviate/
abbrev = 12
# Use (a copy of) the "diff-highlight" contrib script for more readable diffs.
# Get it at <https://raw.githubusercontent.com/git/git/master/contrib/diff-highlight/diff-highlight>
pager = diff-highlight | less
[color]
# Use colors by default when the output is a terminal that supports them.
ui = auto
[color.grep]
filename = bold green
match = black yellow
[diff]
# Use more time to create better diffs. E.g. matching opening/closing braces
# from neighbour functions.
algorithm = patience
# Tells Git to detect renames. If set to "true", it will enable basic
# rename detection. If set to "copies", it will detect copies, as well.
renames = copies
[merge]
tool = vimdiff
# When merging, add a list of merged commits to the autogenerated commit
# message.
log = true
[push]
# Make "git push" or "git push <remote>" only push the current branch to
# the tracked branch (regardless of its remote name) as opposed to pushing
# all branches with a matching name on the remote. See "An asymmetry
# between git pull and push": http://longair.net/blog/?p=572
default = tracking
[alias]
# When doing "git git log" or some such, do not complain about "git" not
# being a valid Git command. This happens when copy-pasting examples, for
# instance.
git = !git
# Quickly view the latest commits using a helper script to massage the
# "git log" output.
l = tilde-log
# Like "git l", but show all and draw the history graph, too.
ll = tilde-log --graph
# Like "git l", but for the reflog.
rl = tilde-reflog
# Show a concise status of the working directory, along with the branch
# and the number of commits behind and/or ahead.
s = status --short --branch
# Show the staged changes.
dc = diff --cached
# Like "git show myfile", but uses the last commit that changed "myfile".
showlast = log -n 1 -p
# Switch branches, creating them if necessary. I want to unlearn using
# "git checkout" for switching between branches because of the possible
# dataloss when not paying attention. (You could see the PEBKAC, but I
# could reply with another four letter acronym, slightly resembling TOFU.)
#
# Suppose I have modified a file named "password" and have two branches,
# "password-expiry-mechanism" and "password-reset-mail". If I want to
# switch to either branch, I would type "git checkout pass<Tab><Enter>",
# but the autocomplete would stop at "git checkout password" because of
# the ambiguity. Because I press <Enter> without really thinking, I have
# now reset my "password" file. With "git go pass<Tab><Enter>", I would
# simply have created a new branch called "password". (I would be forced
# to use "--" to separate paths from banch names, which is a Good Thing™.)
go = checkout -B
# Make "git grep" look a bit like "ack"/"ag". Note that you need to
# specify --no-index to search all files, and that submodules are not
# searched.
ack = grep --extended-regexp --break --heading --line-number