-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_gitconfig.tmpl
186 lines (143 loc) · 3.79 KB
/
dot_gitconfig.tmpl
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
{{- /*
vim:ft=ini.gotexttmpl
*/ -}}
[core]
excludesfile = ~/.gitignore_global
editor = $EDITOR
{{ if lookPath "delta" }}
pager = delta --tabs {{ .tui.tabs }}
{{ else }}
pager = less -R --tabs={{ .tui.tabs }}
{{ end }}
autocrlf = false
safecrlf = true
whitespace = fix, indent-with-non-tab, space-before-tab, trailing-space, cr-at-eol, blank-at-eol, blank-at-eof, tabwidth = {{ .tui.tabs }}
[user]
name = {{ .uname | quote }}
email = {{ .email | quote }}
{{- if lookPath "delta" }}
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
side-by-side = true
line-numbers = true
{{ end -}}
[diff]
renames = copy
colorMoved = default
[difftool]
prompt = 0
[merge]
conflictStyle = zdiff3
[mergetool]
keepBackup = true
[pull]
rebase = false
[push]
default = matching
[rebase]
autosquash = true
autostash = true
[tag]
sort = version:refname
[credential]
helper = cache --timeout=900
[grep]
lineNumber = true
extendedRegexp = true
[log]
decorate = full
[http]
cookiefile = ~/.gitcookies
[alias]
a = add
aa = commit --amend --no-edit
ap = add --patch
au = add --update
c = commit -v
ph = push
p = pull
pr = pull --rebase
p-to-all-remotes = !git remote | xargs -I% -n1 git push %
cp = cherry-pick
s = switch
f = fetch
fa = fetch --all
# rebase - forward-port local commits to the updated upstream head.
rb = rebase
# rebase - continue the rebasing process after resolving a conflict manually and updating the index with the resolution.
rbc = rebase --continue
# rebase - restart the rebasing process by skipping the current patch.
rbs = rebase --skip
rename = branch -m
t = tag
tph = push origin --tags
td = tag -d
done = !git push origin HEAD #push changes to upstream
co = checkout
cob = checkout -b #create new branch and switch
del = branch -D #delete branch
cl = clone
br = branch
br-name = rev-parse --abbrev-ref HEAD
br-all = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate #list all branches
upstream-name = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)
df = diff
diff = diff --word-diff
dc = diff --cached
st = status -sb
su = status -sb --untracked-files=no
l = log
lh = log --graph
la = !git lh --date-order --all 2> /dev/null
lb = log --graph --simplify-by-decoration
lba = !git lb --all
# resets without explanation
undo = reset HEAD~1 --mixed
r0 = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
# stash shortcuts
sl = stash list
sa = stash apply
ss = stash save
sr = stash apply --index
# search for TODO
todo = grep TODO
# show all prfiles
ls = !git rev-parse --abbrev-ref HEAD | xargs git ls-tree -r --full-tree --full-name --name-only
# push into current remote branch
pc = !git rev-parse --abbrev-ref HEAD | xargs git push origin
# show conflicts
conflicts = !git ls-files --unmerged | cut -f2 | sort -u | xargs grep -El '<<<<<<<|=======|>>>>>>>'
# show aliases
aliases = !git config -l | grep alias | cut -c 7-
# assume a file as unchanged
assume = !gitt update-index --assume-unchanged
# unassume a file
unassume = !gitignoret update-index --no-assume-unchanged
# show assumed files
assumed = !git ls-files -v | grep ^h | cut -c 3-
# pull from remote repository
fork = !git config --get remote.origin.url | xargs git pull
[help]
autocorrect = 1
[filter "media"]
required = true
clean = git media clean %f
smudge = git media smudge %f
[filter "hawser"]
clean = git hawser clean %f
smudge = git hawser smudge %f
required = true
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
process = git-lfs filter-process
[include]
path = ~/.gitconfig.d/*