-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathgitconfig
More file actions
253 lines (189 loc) · 5.54 KB
/
gitconfig
File metadata and controls
253 lines (189 loc) · 5.54 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
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
[include]
path = ~/.gitconfig.private
[core]
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab
quotepath = false
pager = less -FXR
editor = vim -pc ':normal gg'
[alias]
clone = clone --recursive
a = add
aa = add --all --intent-to-add
ae = add --edit
ai = add --interactive
amend = commit --amend --reuse-message=HEAD
ap = add --patch
at = add --intent-to-add
au = add --update
authors = "!git log --pretty=format:%aN | sort | uniq -c | sort -rn"
b = branch -vv
c = commit
ca = commit --amend
changes = diff --name-status -r
check = diff --check
cm = commit --message
co = checkout
cpc = cherry-pick --signoff
d = diff --ignore-all-space
dc = diff --cached --ignore-all-space
div = divergence
dt = difftool
h = help
list-aliases = "!git config -l | grep alias | cut -c 7-"
la = "!git list-aliases"
ls-ignored = ls-files --exclude-standard --ignored --others
markdown = !BN=$(git name-rev --name-only HEAD) && git log --no-merges --grep=$BN --pretty=oneline | awk -F"$BN: " '{print \"-\", $NF}' | uniq
# Create an empty commit, only having a commit message
msg = commit --allow-empty -m
mt = mergetool
pf = push --force-with-lease
r = remote
rh = reset --hard
ru = remote update --prune
s = status --short --branch
sm = submodule
sma = submodule add
smu = submodule update --init --recursive
tags = tag -l
wd = diff --word-diff="color"
wdc = diff --word-diff="color" --cached
push = push --tags
regret = reset
# Make stashing easier
st = stash
stl = stash list
stp = stash pop
# Make rebasing easier
irb = rebase --interactive
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
# Easier merging
m = merge -s recursive -X patience
mm = merge --no-ff
merge-branch = !git checkout master && git merge @{-1}
conflicted = grep --name-only --full-name '<<<<<<< HEAD'
# Pick our version of a file while merging
ours = "!f() { git co --ours $@ && git add $@; }; f"
# Pick their version of a file while merging
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
# Inspect history in various ways
news = log -p HEAD@{1}..HEAD@{0}
sl = shortlog
# Show compact history
l = "!git log -10 --graph --pretty='tformat:%C(yellow)%h{%C(green)%ar{%C(bold blue)%an{%C(red)%d%C(reset) %s' $* | column -t -s '{' | less -FXRS"
# Show commit log using graph notation
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# List commits showing changed files
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ra = log --graph --abbrev-commit --date=relative -20 --all --pretty='format:%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset'
# See all the commits related to a file
filelog = log -u
fl = log -u
# Easily ignore committed, but changed files that I don't want to commit
ignore = update-index --assume-unchanged
ignored = "!git ls-files -v | grep '^[[:lower:]]'"
ignoreall = "!git status -s | awk {'print $2'} | xargs git update-index --assume-unchanged"
unignore = update-index --no-assume-unchanged
unignoreall = "!git assumed | xargs git update-index --no-assume-unchanged"
# The following aliases were nabbed from http://kamalmarhubi.com/blog/2016/02/29/my-git-aliases/
# Print absolute path of repo root directory
root = rev-parse --show-toplevel
# Get to a detached HEAD state on purpose! Usage: `git detach [REF]`
detach = "!sh -c 'git checkout $(git rev-parse ${1:-HEAD})' --"
# Print short sha1; usage: `git sha1 [REF]`
sha1 = "!sh -c 'git rev-parse --short ${1:-HEAD}' --"
[advice]
pushNonFastForward = false
statusHints = false
[apply]
whitespace = nowarn
[pager]
color = true
log = diff-highlight | less
show = diff-highlight | less
diff = diff-highlight | less
[branch]
autosetupmerge = true
[color]
ui = 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
[svn]
brokenSymlinkWorkaround = false
[push]
default = simple
recurseSubmodules = check
[help]
autocorrect = 0
[rerere]
enabled = 1
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[diff]
renames = copies
mnemonicprefix = true
tool = Kaleidoscope
algorithm = histogram
compactionHeuristic = true
[difftool]
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[merge]
stat = true
diff = vimdiff
tool = Kaleidoscope
[mergetool]
prompt = false
[rebase]
autosquash = true
[diff "zip"]
textconv = unzip -c -a
[credential]
helper = osxkeychain
[status]
submodulesummary = true
#[init]
# templatedir = ~/.git-template
[diff "plist"]
textconv = "plutil -convert xml1 -o -"
[diff "localizablestrings"]
textconv = "iconv -f utf-16 -t utf-8"
[remote]
pushdefault = origin
[transfer]
fsckObjects = true
[fetch]
fsckObjects = true
[receive]
fsckObjects = true
[interactive]
diffFilter = diff-highlight
# URL shorthands
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[url "git://gist.github.com/"]
insteadOf = "gist:"