-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
207 lines (205 loc) · 6.4 KB
/
Copy path.gitconfig
File metadata and controls
207 lines (205 loc) · 6.4 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
[alias]
a = add --all
ai = add -i
#############
b = branch
ba = branch -a
bd = branch -d
bdd = branch -D
br = branch -r
bruh = "!r() { refbranch=$1 count=$2; git for-each-ref --sort=-committerdate refs/heads --format='%(refname:short)|%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always --count=${count:-20} | while read line; do branch=$(echo \"$line\" | awk 'BEGIN { FS = \"|\" }; { print $1 }' | tr -d '*'); ahead=$(git rev-list --count \"${refbranch:-origin/master}..${branch}\"); behind=$(git rev-list --count \"${branch}..${refbranch:-origin/master}\"); colorline=$(echo \"$line\" | sed 's/^[^|]*|//'); echo \"$ahead|$behind|$colorline\" | awk -F'|' -vOFS='|' '{$5=substr($5,1,70)}1' ; done | ( echo \"ahead|behind|branch|lastcommit|message|author\\n\" && cat) | column -ts'|';}; r"
bc = rev-parse --abbrev-ref HEAD
bu = !git rev-parse --abbrev-ref --symbolic-full-name \"@{u}\"
bs = branch --sort=-committerdate
#############
c = commit
ca = commit -a
cm = commit -m
cam = commit -am
cem = commit --allow-empty -m
cd = commit --amend
# Equivalent to
# $ git reset --soft HEAD~
# $ ... do something else to come up with the right tree ...
# $ git commit -c ORIG_HEAD
cad = commit -a --amend
ced = commit --allow-empty --amend
clm = commit -C HEAD@{1} # git commit -C@@{1} commit with previous msg
calm = commit -a -C@@{1}
#############
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
#############
d = diff
dp = diff --patience
dc = diff --cached
dk = diff --check
dck = diff --cached --check
#############
f = fetch
fo = fetch origin
fu = fetch upstream
#############
g = grep -p
#############
h = hist
#############
l = log --oneline
lg = log --oneline --graph --decorate
lh = log --color --pretty=format:\"%C(yellow)%h%C(reset) %s%C(bold red)%d%C(reset) %C(green)%ad%C(reset) %C(blue)[%an]%C(reset)\" --relative-date --decorate
#############
ls = ls-files
lsc = !git ls-files | xargs git add
lsf = !git ls-files | grep -i
#############
m = merge
ma = merge --abort
mc = merge --continue
ms = merge --skip
#############
o = checkout
ob = checkout -b
#############
pr = !git publish && hub pull-request
#############
prune = prune -v
#############
p = push
pf = push --force-with-lease
pu = push -u
pt = push --tags
#############
po = push origin
pao = push --all origin
pfo = push --force-with-lease origin
puo = push -u origin
#############
pom = push origin master
paom = push --all origin master
pfom = push --force-with-lease origin master
puom = push -u origin master
poc = !git push origin $(git bc)
paoc = !git push --all origin $(git bc)
pfoc = !git push -f origin $(git bc)
puoc = !git push -u origin $(git bc)
pdc = !git push origin :$(git bc)
#############
pl = pull
pb = pull --rebase
#############
plo = pull origin
pbo = pull --rebase origin
plom = pull origin master
ploc = !git pull origin $(git bc)
pbom = pull --rebase origin master
pboc = !git pull --rebase origin $(git bc)
#############
plo = pull origin
pbo = pull --rebase origin
plom = pull origin master
ploc = !git pull origin $(git bc)
pbom = pull --rebase origin master
pboc = !git pull --rebase origin $(git bc)
#############
r = reset HEAD
rhd = reset --hard
rs = reset --soft
rh = reset HEAD~
rhh = reset --hard HEAD~
rsh = reset --soft HEAD~
#############
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbi = rebase --interactive
rbs = rebase --skip
#############
rf = reflog
rfh = reflog --all | head -n 1 | awk '{print $1;}'
#############
rm = remote
rma = remote add
rmr = remote rm
rmv = remote -v
rmn = remote rename
rmp = remote prune
rms = remote show
rmao = remote add origin
rmau = remote add upstream
rmro = remote remove origin
rmru = remote remove upstream
rmso = remote show origin
rmsu = remote show upstream
rmpo = remote prune origin
rmpu = remote prune upstream
#############
# Remove files from the working tree and from the index
rmf = rm -f
rmrf = rm -r -f # Allow recursive removal when a leading directory name is given
#############
s = status
sb = status -s -b # Short format
#############
sa = stash apply
sc = stash clear
sd = stash drop
sl = stash list
sp = stash pop
ss = stash save
ssk = stash save -k
sw = stash show
st = !git stash list | wc -l 2>/dev/null | grep -oEi '[0-9][0-9]*' # No of stashes
#############
w = show
#############
# Modifies the index or directory cache.
assume = update-index --assume-unchanged # ignore watching/tracking a particular dir/file
unassume = update-index --no-assume-unchanged
assumed = !git ls -v | grep ^h | cut -c 3-
unassumeall = !git assumed | xargs git unassume
assumeall = !git status -s | awk {'print $2'} | xargs git assume
#############
# Count commits since branching out from master
merged = !sh -c 'git o master && git plom && git bd $1 && git rpo' -
aliases = !git config -l | grep alias | cut -c 7-
snap = !git stash save 'snapshot: $(date)'
# squash
count = rev-list --count origin/master..HEAD
squash = !git rebase -i HEAD~$(git count)
sq = !git rebase -i HEAD~$(git rev-list --count origin/main..HEAD)
whosgottest = !git for-each-ref --format='%(authordate:format:%m/%d/%Y %I:%M %p) %(align:25,left)%(color:yellow)%(authorname)%(end) %(color:reset)%(refname:strip=3)' --sort=authordate refs/remotes | grep 'test/'
main = !git o main && git pull --rebase
ch = !git log --reverse -L :get_locale:$1
# https://qiita.com/sin_tanaka/items/ca0fdd899e40a1d6716b
cof = !git branch -a | fzf | xargs git checkout
prebase = rebase -x 'pre-commit run --from-ref HEAD~ --to-ref HEAD'
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
; excludesfile = /Users/abdulkarim/.gitignore_global
editor = /usr/local/bin/nvim
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[diff-so-fancy]
markEmptyLines = false
[user]
name = crabdul
email = 23074754+crabdul@users.noreply.github.com
[includeIf "gitdir:~/workspace/"]
path = .gitconfig-work
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[commit]
template = /Users/karim/.git_commit_msg.txt