-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
181 lines (181 loc) · 8.02 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
[alias]
a = add
ac = !git a . && git cm
ai = add --interactive
ama = am --abort
amc = am --continue
amscp = am --show-current-patch
ams = am --skip
ap = add --patch
at = !"append_ticket() { if [ $# -gt 0 ]; then git ca -m \"$1 $(git lgs)\n\n$(git lgb)\"; else echo 'supply some ticket(s) to prepend to the summary'; fi; }; append_ticket"
authors = shortlog -s -e -n --all
br = branch -vv
brav = branch --all -vv
bss = bisect start
bsb = bisect bad
bsg = bisect good
bsl = bisect log
bsr = bisect run
brc = !"git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' | sort -k5n -k2M -k3n -k4n"
ca = commit --amend
caa = !"amend_author() { local author=\"$1\" && shift; git ca --no-edit --author \"$author\" \"$@\" && git rc; }; amend_author"
fixauthor = -c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE="%cD" GIT_AUTHOR_DATE="%aD" git commit --amend --no-edit --reset-author' rebase -f
ce = config --global --edit
co = checkout
cop = checkout --patch
cob = checkout -b
cocs = !"checkout_clean_submodules() { git co $1; git smu; git cfd; git smc; }; checkout_clean_submodules"
cfd = clean -ffd
ci = commit
cm = commit -m
cia = commit -C HEAD@{1}
ciae = commit -c HEAD@{1}
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
dc = diff --cached
ds = diff --stat
du = !"diff_upstream() { local branch=$1; test -n \"$1\" && shift; git diff --pretty=authoneline --reverse $(git ub ${branch})..${branch} \"$@\"; }; diff_upstream"
dus = du HEAD --stat
ffm = merge --ff-only
fu = commit --amend --no-edit
fuc = commit --fixup
lg = log --pretty=authoneline
lga = log -n1 HEAD@{1}
lgf = log --pretty=authonelinefull
lgs = !"log_summary() { git log -n1 --format=%s HEAD~${1:-0}; }; log_summary"
lgb = !"log_body() { git log -n1 --format=%b HEAD~${1:-0}; }; log_body"
lgi = !"log_incoming() { local branch=${1:-}; git log --pretty=authoneline ${branch}..$(git ub ${branch}); }; log_incoming"
lgu = !"log_upstream() { local branch=${1:-}; git log --pretty=authoneline --reverse $(git ub ${branch})..${branch}; }; log_upstream"
lgus = !git lgu --stat
lgut = !git lgu | tail
lsall = !"list_all() { git log --all --pretty=format: --name-only --diff-filter=A \"$@\" | grep . | sort -u; }; list_all"
ma = merge --abort
me = !"git lg --author=\"$(git config user.name)\""
pp = !"git lgu; echo; git dus"
pr = pull --rebase
prp = !git pr && git push
pf = push --force-with-lease
ra = rebase --abort
rb = rebase
rc = rebase --continue
rs = rebase --skip
ri = rebase --interactive
rl = reflog --pretty=refonelinefull
rsh = reset HEAD
rsa = reset --keep
rsp = reset --patch
rss = reset --soft
rssh = reset --soft HEAD~1
release = !"release_name() { git describe --tags --match \"$(basename $(pwd))-v*\" --exclude '*-rc*'; }; release_name"
customrelease = !"custom_release() { \
if [ $# -lt 1 ]; then \
echo \"usage: git customrelease version\"; \
return; \
fi; \
local version=$1 && shift; \
local repo_name=$(git reponame); \
local release_pattern; \
if [ \"${repo_name}\" = '' ]; then \
release_pattern=\"${version}\"; \
else \
release_pattern=\"${version}\"; \
fi; \
git describe --tags --match \"${release_pattern}\" --abbrev=0; \
}; custom_release"
renametag = !"renametag() { local oldtag=$1 && shift; local newtag=$1 && shift; if [[ -z \"$oldtag\" || -z \"$newtag\" ]]; then echo \"usage: git renametag oldtag newtag\"; return 1; fi; git tag $newtag $(git cat-file -p $oldtag | sed \"s/^tag $oldtag$/tag $newtag/\" | git mktag) && git tag -d $oldtag; }; renametag"
raf = !"add_fork() { local remote=$1 && shift; local org=${2:-${remote}}; local original_remote=${3:-origin}; if [[ -z \"${remote}\" || -z \"${org}\" ]]; then echo \"usage: git raf remote [org] [original_remote]\"; git remotes; return 1; else local remote_url=$(git url ${remote}); if [[ -n \"${remote_url}\" ]]; then echo \"${remote} already exists with URL ${remote_url}\"; else local fork_url=$(git forkurl ${org} ${original_remote}); echo \"adding ${remote} -> ${fork_url}\"; git remote add ${remote} ${fork_url}; fi; fi; }; add_fork"
remotes = !"show_remotes() { local remote; for remote in $(git remote show); do printf \"%-20s %s\n\" ${remote} $(git url ${remote}); done; }; show_remotes"
rso = remote show origin
rv = revert --no-commit
rva = revert --abort
rvc = revert --continue
rvh = revert --no-commit HEAD
sa = stash apply
sd = stash drop
sl = stash list --pretty=stashoneline
sm = submodule
smc = submodule foreach --recursive git clean -ffd
sms = submodule foreach --recursive git status
smi = submodule update --init --recursive
smu = submodule update --recursive
sp = stash pop
sr = !"renamestash() { local number=$1 && shift; local message=$1 && shift; if [[ -z \"${number}\" || -z \"${message}\" ]]; then echo \"usage: git sr number name\"; git stash list; return 1; else local stash=\"stash@{$number}\"; local rev=$(git rev-parse \"${stash}\"); git stash drop \"${stash}\" || return 1; git stash store -m \"${message}\" \"${rev}\" || return 1; git stash list; fi }; renamestash"
ss = stash show --patch
su = stash push --keep-index --include-untracked
st = status
sti = status --ignore
bb = !echo $(git cb)_bb
cb = rev-parse --abbrev-ref HEAD
ub = !"upstream_branch() { local branch=${1:-}; git rev-parse --abbrev-ref --symbolic-full-name ${branch}@{upstream}; }; upstream_branch"
up = git branch --set-upstream-to
qb = !git br $(git bb)
qd = !git br -D $(git bb)
db = !git diff $(git bb)
forkurl = !"fork_url() { local fork=$1 && shift; local remote=${1:-origin}; git url ${remote} | sed -Ee \"s/:[^/]+/:$fork/\"; }; fork_url"
name = show --name-only
graph = log --graph --all --pretty=graphtight --abbrev-commit --date=relative
biggraph = log --graph --all --pretty=graphloose --abbrev-commit
tags = tag
tagdates = log --tags --simplify-by-decoration --pretty=tagdates
conflicts = diff --name-only --diff-filter=U
contains = branch -a --contains
ignored = ls-files --others --exclude-standard --ignored
untracked = ls-files --others --exclude-standard
alias = !"show_alias() { if [ $# -gt 0 ]; then git config alias.${1}; else git config --get-regexp ^alias; fi; }; show_alias"
[pretty]
graphtight = %C(bold red)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)- %an%C(reset)%C(bold yellow)%d%C(reset)
graphloose = %C(bold red)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset) %C(bold white)- %an%C(reset)
authoneline = %C(bold red)%h %C(reset)%s %C(bold green)%aN %C(bold magenta)(%ar)%C(reset)%C(yellow)%d%C(reset)
authonelinefull = %C(bold red)%h %C(reset)%s %C(bold green)%aN %C(bold magenta)(%aD)%C(reset)%C(yellow)%d%C(reset)
stashoneline = %C(bold red)%h %C(bold green)%gd %C(reset)%gs %C(bold green)%aN %C(bold magenta)(%ar)%C(reset)%C(yellow)%d%C(reset)
refonelinefull = %C(auto)%h %gd: %gs %C(bold magenta)(%aD)%C(reset)
tagdates = %ci %d
[format]
pretty = fuller
[user]
name = Sam Brightman
# email from include
[include]
path = .gitconfig_user
path = .gitconfig_tokens
path = .gitconfig_bullshit
path = .gitconfig_shared
path = .gitconfig_work
[includeIf "gitdir:~/dev/"]
path = .gitconfig_user_home
[branch]
autosetupmerge = inherit
autosetuprebase = always
[color]
ui = true
[core]
editor = emacswrapper
excludesFile = ~/.gitignore
[diff]
noprefix = true
[pager]
blame = less -S
[pull]
rebase = true
[push]
default = current
followTags = true
[rebase]
autosquash = true
autostash = true
[github]
user = sambrightman
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[credential]
helper = store
[checkout]
workers = 0
[fetch]
parallel = 0
[advice]
skippedCherryPicks = false