-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
executable file
·131 lines (111 loc) · 3.23 KB
/
.gitconfig
File metadata and controls
executable file
·131 lines (111 loc) · 3.23 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
[user]
name = jz
email = macgyver@users.noreply.github.com
[color]
ui = true
[credential]
helper = osxkeychain
[core]
excludesfile = ~/.gitignore_global
pager = diff-so-fancy | less --tabs=4 -RFX
[log]
abbrevCommit = true
[alias]
la = "!git config -l | grep alias | cut -c 7-"
recent-branches=for-each-ref --sort=-committerdate --count=25 --format='%(refname:short) %(color:cyan)(%(committerdate:relative))%(color:reset)' refs/heads/
rb = recent-branches
prune-origin = !git branch -r --merged master \
| sed -E 's/^[[:space:]]*origin\\///' \
| grep -v -E '^(master$|develop$|stage$|QA$|release-)' \
| xargs -n 1 git push --delete origin
todev = "!export branch_name=$(git rev-parse --abbrev-ref HEAD) && git co develop && git pull --rebase origin develop && git merge -s recursive -X theirs ${branch_name} && git push && git co -"
# Shortcuts
a = add
br = branch
ci = commit
cl = clone
co = checkout
cp = cherry-pick
s = status
# Checkout
cog = "!f() { git branch | grep \"$1\" | xargs git checkout; }; f"
# Add
ai = add -i
ap = add -p
au = add -u
# Commit
cm = commit -m
cma = commit -a -m
cam = commit -a -m
ca = commit --amend
amend = commit --amend
caa = commit -a --amend -C HEAD
# Log
filelog = log -u
lc = "!f() { git ll "$1"^.."$1"; }; f"
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
lol = log --graph --all --decorate --oneline
# Branch
bra = branch -ra
# Diff
d = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
dif = diff -U24
ds = diff --staged
dt = diff --stat
dts = diff --staged --stat
dl = "!git ll -1"
# Diff last commit
dlc = diff --cached HEAD^
dr = "!f() { git diff "$1"^.."$1"; }; f"
diffr = "!f() { git diff "$1"^.."$1"; }; f"
# Status
st = status -s -b
# Stash
sl = stash list
sa = stash apply
ss = stash save
sp = stash pop
# Grep
grep = grep -Ii
gr = grep -Ii
# Grep root directory
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
# Grep on filename
f = "!git ls-files | grep -i"
# Tags
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
[push]
default = current
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[tag]
sort = version:refname
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
# Push/Pull
pulp = git pull --prune
pusu = git push -u
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[rerere]
enabled = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[pull]
ff = only