-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig
More file actions
271 lines (245 loc) · 8.29 KB
/
gitconfig
File metadata and controls
271 lines (245 loc) · 8.29 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# set your user tokens as enivornment variables, such as ~/.secrets
# See the README for examples.
[color]
ui = auto
diff = auto
status = auto
branch = 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 = green
changed = blue bold
untracked = red
[core]
editor = nvim
excludesfile = ~/.gitignore
pager = less -FRSX
quotepath = false
eol = lf
autocrlf = input
fsmonitor = true
untrackedCache = true
[alias]
# workflow
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# add
a = add # add
aa = add -A
chunkyadd = add --patch # stage commits chunk by chunk
# branch
b = branch -v # branch (verbose)
br = branch
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
bdclean = "!f() { git branch --merged ${1-develop} | grep -v " ${1-develop}$" | xargs git branch -d; }; f"
bddone = "!f() { git checkout ${1-develop} && git up && git bdclean ${1-develop}; }; f"
bmclean = "!f() { git branch --merged ${1-main} | grep -v " ${1-main}$" | xargs git branch -d; }; f"
bmdone = "!f() { git checkout ${1-main} && git up && git bclean ${1-main}; }; f"
# commit
blame = blame -C
c = commit -m # commit with message
ca = commit -am # commit all with message
ci = commit -sv # commit
amend = commit --amend # ammend your last commit
ammend = commit --amend # ammend your last commit
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = commit -am "[CI Skip] WIP"
# checkout
co = checkout # checkout
nb = checkout -b # create and switch to a new branch (mnemonic: "git new branch branchname...")
# cherry-pick
cp = cherry-pick -x # grab a change from a branch
# diff
d = diff # diff unstaged changes
df = diff
dw = diff --word-diff
dc = diff --cached # diff staged changes
last = diff HEAD^ # diff last committed change
today = diff --stat @{12am}..HEAD
# log
tree = log --graph --decorate --pretty=format:'%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset' --abbrev-commit --date=relative
l = log --graph --date=short
lg = log --graph --decorate --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lol = log --graph --decorate --oneline
lola = log --graph --decorate --oneline --all
changes = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\" --name-status
short = log --pretty=format:\"%h %cr %cn %Cgreen%s%Creset\"
changelog = log --pretty=format:\" * %s\"
shortnocolor = log --pretty=format:\"%h %cr %cn %s\"
show-graph = log --graph --abbrev-commit --pretty=oneline
standup = "!git log --since yesterday --author `git config user.email` --pretty=short"
# config
ec = config --global -e
# pull
pl = pull
ff = merge --ff-only
pullff = pull --ff-only
noff = merge --no-ff
fa = fetch --all
purr = pull --rebase
# push
ps = push # push
pom = push origin master
pod = push origin dev
# rebase
ready = rebase -i @{u}
rc = rebase --continue # continue rebase
rs = rebase --skip # skip rebase
eject=!git reset --hard && git checkout master && git rebase --abort
# remote
r = remote -v # show remotes (verbose)
# reset
unstage = reset HEAD # remove files from index (tracking)
uncommit = reset --soft HEAD^ # go back before last commit, with files in uncommitted state
filelog = log -u # show changes to a file
mt = mergetool # fire up the merge tool
undo = reset HEAD~1 --mixed
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
# stash
ss = stash # stash changes
sl = stash list # list stashes
sa = stash apply # apply stash (restore changes)
sd = stash drop # drop stashes (destory changes)
# status
s = status # status
sb = status -sb
st = status # status
stat = status # status
# tag
t = tag -n # show tags with <n> lines of each tag message
# svn helpers
svnr = svn rebase
svnd = svn dcommit
svnl = svn log --oneline --show-commit
# Divergence (commits we added and commits remote added)
div = divergence
# Goodness (summary of diff lines added/removed/total)
gn = goodness
gnc = goodness --cached
untracked = ls-files -o --exclude-standard
ignored = ls-files --others -i --exclude-standard
modified = ls-files -m
todo = !git grep --color=always --no-index --exclude-standard --heading --break --ignore-case -e ' FIX: *' -e ' TODO: *' | sed -e 's/^[[:space:]]*//'
g = grep --break --heading --line-number
#[format]
# pretty = format:%C(blue)%ad%Creset %C(yellow)%h%C(green)%d%Creset %C(blue)%s %C(magenta) [%an]%Creset
[mergetool]
prompt = false
[mergetool "mvimdiff"]
cmd = "mvim -c 'Gdiff' $MERGED" # use fugitive.vim for 3-way merge
keepbackup = false
[merge]
summary = true
verbosity = 1
prompt = false
tool = vscode
conflictstyle = zdiff3
#tool = Kaleidoscope
#tool = mvimdiff
#tool = sourcetree
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[credential]
helper = cache --timeout=3600
# helper = osxkeychain
#[apply]
# whitespace = nowarn
#[branch]
# autosetupmerge = true
# autosetuprebase = always
#[branch "master"]
# rebase = true
[push]
# 'git push' will push the current branch to its tracking branch
# the usual default is to push all branches
default = simple
autoSetupRemote = true
followTags = true
#[advice]
# statusHints = false
[diff]
# Git diff will use (i)ndex, (w)ork tree, (c)ommit and (o)bject
# instead of a/b/c/d as prefixes for patches
mnemonicPrefix = true
algorithm = histogram
colorMoved = plain
renames = true
# tool = vscode
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[rerere]
# Remember my merges
# http://gitfu.wordpress.com/2008/04/20/git-rerere-rereremember-what-you-did-last-time/
enabled = true
autoupdate = true
[interactive]
singlekey = true
[achievement]
upload = true
[user]
name = Douglas Kayama
email = douglas@kayama.tech
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGV8PW5qQ5LEUjUwrb0fgTRaDnJZ41B8g9sy7vNki60n
[grep]
extendRegexp = true
lineNumber = true
[github]
user = douglaskayama
#[filter "media"]
# clean = git-media-clean %f
# smudge = git-media-smudge %f
[difftool "vscode"]
cmd = "code --wait --diff "
[mergetool "vscode"]
cmd = "code --wait "
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
[commit]
gpgsign = true
verbose = true
[init]
defaultBranch = main
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[column]
ui = auto
[branch]
sort = -committerdate
[tag]
sort = version:refname
[fetch]
prune = true
pruneTags = true
all = true
[help]
autocorrect = prompt
[rebase]
autoSquash = true
autoStash = true
updateRefs = true
[pull]
rebase = true