-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitconfig
138 lines (122 loc) · 4.04 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
[push]
default = current
[branch]
autosetuprebase = always
[color]
ui = auto
[alias]
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t = \\2/' | sort
ignore = !([ ! -e .gitignore ] && touch .gitignore) | echo $1 >> .gitignore
su = submodule update
chpk = cherry-pick
# status
s = status --short --branch
st = status
ss = status -s
sh = show
so = remote show origin
brr = browse-remote
# pull/push/fetch
f = fetch
fa = fetch --all
fp = fetch --prune
up = pull --rebase
po = push origin
pof = push -f origin
pu = push -u origin
# push current branch to origin with --upstream
puc = "!f() { git push origin -u `git symbolic-ref --short HEAD` ;}; f"
# rebase
r = rebase
rbm = rebase --merge master
rbd = rebase --merge develop
rbc = rebase --continue
rba = rebase --abort
rbi = rebase -i
rbi1 = rebase -i HEAD^
rbi2 = rebase -i HEAD^^
rbi3 = rebase -i HEAD^^^
rbi4 = rebase -i HEAD^^^^
rbi5 = rebase -i HEAD^^^^^
# merge
mn = merge --no-ff
# commit
ad = add
ci = commit
ca = commit -a
# checkout
co = checkout
cb = checkout -b
ct = checkout --track
cm = checkout master
cd = checkout develop
# branch
br = branch
ba = branch -a
bm = branch --merged
bn = branch --no-merged
bnd = branch --no-merged develop
bo = branch -r
# log
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
wc = whatchanged
tree = log --graph --decorate --pretty=oneline --abbrev-commit --color
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(green)(%ar)%C(reset) %C(normal)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold red)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold magenta)%aD%C(reset) %C(green)(%ar)%C(reset)%C(bold red)%d%C(reset)%n'' %C(normal)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !git lg1
ls = log --stat
la = log --pretty=\"format:%ad %h (%an): %s\" --date=short # ざっくりログ出す
lr = log origin
ll1 = log --date=short --max-count=1 --pretty=format:'%Cgreen%h %cd %Cblue%cn%x09%Creset%s'
l = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset'
# ll = log --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn%x09%Creset%s'
ll = log --stat --abbrev-commit
ln = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(green)- %an, %cr%Creset' --name-status
lp = log --oneline -p
# lp = log -p
lc = !git --no-pager log --color --graph --abbrev-commit --decorate --pretty=oneline -n
# ls = log --stat --abbrev-commit -n 1
oneline = log --pretty=oneline
ranking = shortlog -s -n --no-merges
log-graph = log --graph --date=short --pretty=format:'%Cgreen%h %cd %Cblue%cn %Creset%s'
log-all = log --graph --all --color --pretty='%x09%h %cn%x09%s %Cred%d%Creset'
unpushed = log --branches --not --remotes --simplify-by-decoration --decorate --oneline
# reset
r0 = reset HEAD
r1 = reset HEAD~
r2 = reset HEAD~~
r3 = reset HEAD~~~
r4 = reset HEAD~~~~
r5 = reset HEAD~~~~~
rsh = reset --soft HEAD
rsh1 = reset --soft HEAD~
rsh2 = reset --soft HEAD~~
rsh3 = reset --soft HEAD~~~
rsh4 = reset --soft HEAD~~~~
rsh5 = reset --soft HEAD~~~~~
rhh = reset --hard HEAD
rhh1 = reset --hard HEAD~
rhh2 = reset --hard HEAD~~
rhh3 = reset --hard HEAD~~~
rhh4 = reset --hard HEAD~~~~
rhh5 = reset --hard HEAD~~~~~
cancel = !git commit -a -m 'Temporary commit for cancel' && git reset --hard HEAD~
# diff
d = diff
dc = diff --cached
dm = diff master
dd = diff develop
dw = diff --color-words
dc = diff --cached
ds = diff --staged
d1 = diff HEAD~
d2 = diff HEAD~~
d3 = diff HEAD~~~
d4 = diff HEAD~~~~
d5 = diff HEAD~~~~~
d10 = diff HEAD~~~~~~~~~~
# go to root folder
root = !cd "$(git rev-parse --show-toplevel)"
[user]
name = Rishabh Mahajan
email = [email protected]