-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
134 lines (132 loc) · 4.12 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
[advice]
detachedHead = false
[alias]
ama = am --abort
authors = "!f() { git log --oneline --pretty='%ae' | sort | uniq -c | sort -nk1; }; f"
# Get all of the blobs in the repo's history, sorted by size
blobs = "!f() { git rev-list --objects --all \
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
| awk '/^blob/ {print substr($0,6)}' \
| sort --numeric-sort --key=2 \
| cut --complement --characters=13-40 \
| numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest; \
}; f"
bi = bisect
bib = bisect bad
big = bisect good
bir = bisect reset
bis = bisect start
br = branch
bra = branch --all
ca = commit --amend --no-edit
cae = commit --amend
ci = commit
ciam = commit -a -m
cin = commit --no-verify
cl = clone
co = checkout
cob = checkout -b
cop = "!f() { git fetch ${2:-origin} pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
df = diff
dfc = diff --cached
dfh = diff -- .
dfs = diff --stat
dod = diff origin/dev...HEAD -w
dods = diff origin/dev...HEAD -w --stat
dom = diff origin/master...HEAD -w
doms = diff origin/master...HEAD -w --stat
f = fetch --all --tags --prune
fa = fetch --all --tags --prune
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
g = !exec git
git = !exec git
l = log
ld = log --decorate
lg = log --decorate --oneline --graph --branches --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold blue)(%ar) %C(bold yellow)%d%C(reset) %C(green)%s%C(reset) %C(dim green)- %an%C(reset)'
logdog = log --decorate --oneline --graph
lp = log -p --stat
ls = log --stat
p = pull
pp = "!git pull && git push"
pr = pull-request
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
pu = push
puf = push -f
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbi = rebase --interactive
rfm = rf master
rmt = remote -v
rod = rebase origin/dev -i
rom = rebase origin/master -i
ros = rebase origin/stage -i
rot = rebase origin/testing -i
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
rso = "!f() { git fetch; git branch --set-upstream-to=origin/$(git sb) $(git sb); git reset --hard origin/$(git sb); git log -1; }; f"
s = show
sb = "!f() { git branch | grep '*' | awk '{print $2}'; }; f"
sed = "!f() { \
for fn in $(git ls-files ${GIT_PREFIX:-.}); do \
if [ -L $fn ]; then continue; fi; \
(set -x; sed -i \"$1\" $fn;) \
done \
}; f"
shows = show --stat
ss = show --stat
st = status
ud = branch --set-upstream-to=origin/dev
um = branch --set-upstream-to=origin/master
up = unpulled
us = branch --set-upstream-to=origin/stage
ut = branch --set-upstream-to=origin/testing
# List aliases
la = "!git config -l | grep alias | cut -c 7-"
[color]
ui = true
status = true
branch = true
diff = true
[color "diff"]
meta = yellow
frag = magenta bold
commit = yellow bold
whitespace = red reverse
[commit]
verbose = true
[core]
pager = less -F -X -R
preloadindex = true
excludesfile = ~/.gitignore_global
[credential]
helper = cache --timeout=432000
[diff]
algorithm = patience
renameLimit = 2500
[grep]
lineNumber = true
[init]
templatedir = ~/.git_template
[magit]
hideCampaign = true
[merge]
tool = fugitive
[mergetool]
keepBackup = false
[mergetool "fugitive"]
cmd = vim -f -c \"Gvdiff\" \"$MERGED\"
[protocol]
version = 2
[pull]
rebase = false
[push]
autoSetupRemote = true
default = simple
[rerere]
enabled = true
# Allow local customizations
[include]
path = ~/.gitconfig_local