-
Notifications
You must be signed in to change notification settings - Fork 2
/
gitconfig
139 lines (126 loc) · 3.19 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
[include]
path=.dotfiles/git/gitconfig.local
[color]
ui = true
[alias]
# Misc
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"
ls-snapshots = !git stash list --grep snapshot
recent-branches = !git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(refname:short)'
# Branch (b)
b=branch
ba=branch --all --verbose --verbose
bl=branch --verbose --verbose
bc=checkout -b
bx=branch --delete
bm=branch --move
bs=show-branch
# Commit (c)
c=commit
ca=commit --all
cm=commit --message
cam=commit --all --message
co=checkout
cop=checkout --patch
cf=commit --amend --reuse-message HEAD
chp=cherry-pick
cr=revert
cres=reset "HEAD^"
cs=show
# Data (d)
d=ls-files
dc=ls-files --cached
dd=ls-files --deleted
dx=ls-files --deleted
dm=ls-files --modified
do=ls-files --other --exclude-standard
dk=ls-files --killed
di=!git status --porcelain --short --ignored | sed -n '"s/^!! //p"'
# Fetch (f)
f=fetch
fa=fetch --all
fc=clone
fp=pull
fr=pull --rebase
fpr=pull --rebase
# Grep (g)
g=grep
gi=grep --ignore-case
gl=grep --files-with-matches
gL=grep --files-without-matches
gv=grep --invert-match
gw=grep --word-regexp
# Index (i)
ia=add
iap=add --patch
iu=add --update
id=diff --no-ext-diff --cached
idw=diff --no-ext-diff --cached --word-diff
ir=reset
irp=reset --patch
ix=rm -r --cached
# Log (l)
l1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
l2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%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(dim white)- %an%C(reset)' --all
l = !git l1
# Merge (m)
m=merge
mnc=merge --no-commit
mf=merge --ff
mnf=merge --no-ff
ma=merge --abort
mt=mergetool
# Push (p)
p=push
pf=push --force-with-lease
pa=push --all
pt=push --tags
pat=push --all && git push --tags
pc=!git push --set-upstream origin "$(git-branch-current 2> /dev/null)"
pp=!git pull origin "$(git-branch-current 2> /dev/null)" && git push origin "$(git-branch-current 2> /dev/null)"
# Rebase (r)
r=rebase
ra=rebase --abort
rc=rebase --continue
ri=rebase --interactive
rs=rebase --skip
# Stash (s)
stsh = stash --keep-index
staash = stash --include-untracked
staaash = stash --all
s=stash
sa=stash apply
sx=stash drop
sl=stash list
sd=stash show --patch --stat
sp=stash pop
ss=stash save
ssu=stash save --include-untracked
# Working Copy (w)
ws=status
wd=diff --no-ext-diff
wdw=diff --no-ext-diff --word-diff
wrs=reset --soft
wrh=reset --hard
wc=clean -n
wcf=clean -f
wcfd=clean -df
wx=rm -r
wxf=rm -rf
[push]
default = upstream
[core]
autocrlf = input
editor = vim
[rerere]
enabled = true
[commit]
verbose = true
[url "https://aur.archlinux.org/"]
insteadOf = "aur:"
[url "ssh+git://aur4.archlinux.org/"]
pushInsteadOf = "aur:"
[url "https://github.com/"]
insteadOf = "gh:"
[url "git@github.com:"]
pushInsteadOf = "gh:"