-
-
Notifications
You must be signed in to change notification settings - Fork 932
/
Copy pathgit_config_with_comments
183 lines (144 loc) · 3.9 KB
/
git_config_with_comments
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
[user]
name = Cody Veal
email = cveal05@gmail.com
[github]
user = cjhveal
[advice]
statusHints = false
[alias]
# add
a = add
aa = add --all
ap = add --patch
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
# branch
br = branch
branches = branch -av
cp = cherry-pick
diverges = !bash -c 'diff -u <(git rev-list --first-parent "${1}") <(git rev-list --first-parent "${2:-HEAD}"g | sed -ne \"s/^ //p\" | head -1' -
track = checkout -t
nb = checkout -b
# commit
amend = commit --amend -C HEAD
c = commit
ca = commit --amend
cm = commit --message
msg = commit --allow-empty -m
co = checkout
# diff
d = diff --color-words # diff by word
ds = diff --staged --color-words
dd = diff --color-words=. # diff by char
dds = diff --staged --color-words=.
dl = diff # diff by line
dls = diff --staged
h = help
# log
authors = "!git log --pretty=format:%aN | sort | uniq -c | sort -rn"
lc = log ORIG_HEAD.. --stat --no-merges
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
# merge
m = merge
mm = merge --no-ff
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# push/pull
l = pull
p = push
sync = !git pull && git push
# remotes
prune-remotes = "!for remote in `git remote`; do git remote prune $remote; done"
r = remote
# rebase
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
# reset
rh = reset --hard
rhh = reset HEAD --hard
uncommit = reset --soft HEAD^
unstage = reset HEAD --
unpush = push -f origin HEAD^:master
# stash
ss = stash
sl = stash list
sp = stash pop
sd = stash drop
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
# status
s = status --short --branch
st = status
# submodule
sm = submodule
sma = submodule add
smu = submodule update --init
pup = !git pull && git submodule init && git submodule update
# file level ignoring
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
[apply]
whitespace = fix
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green
changed = yellow
untracked = cyan
[core]
editor = /usr/bin/vim
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes
[diff]
renames = copies
mnemonicprefix = true
[diff "zip"]
textconv = unzip -c -a
[merge]
log = true
[merge "railsschema"]
name = newer Rails schema version
driver = "ruby -e '\n\
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\
b = File.read(%(%A))\n\
b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\
end\n\
File.open(%(%A), %(w)) {|f| f.write(b)}\n\
exit 1 if b.include?(%(<)*%L)'"
[merge "gemfilelock"]
name = relocks the gemfile.lock
driver = bundle lock
[pager]
color = true
[push]
default = upstream
[rerere]
enabled = true
[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:"
[url "git@heroku.com:"]
insteadOf = "heroku:"