-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
191 lines (169 loc) · 4.63 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
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
[user]
name = Valentin Agachi
email = github-com@agachi.name
[core]
autocrlf = false
excludesfile = ~/.gitignore-global
filemode = true
whitespace = trailing-space,space-before-tab,tabwidth=2
pager = "delta --dark --hunk-style plain --tabs 2"
[help]
autoCorrect = -1
[color]
branch = auto
diff = auto
interactive = auto
status = auto
ui = auto
[color "branch"]
current = white cyan bold
local = cyan
remote = yellow
[color "diff"]
commit = yellow bold
frag = magenta bold
old = red bold
plain = normal
meta = yellow
new = green bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
header = normal
added = green
updated = yellow
changed = magenta
untracked = cyan
[branch]
autosetuprebase = always
[merge]
conflictstyle = diff3
ff = only
# Include summaries of merged commits in newly created merge commit messages
log = true
[fetch]
recurseSubmodules = on-demand
[pull]
ff = only
rebase = true
[push]
default = simple
followTags = true
[log]
date = iso
[status]
showUntrackedFiles = all
submodulesummary = true
[diff]
# Detect copies as well as renames.
renames = copies
submodule = log
tool = icdiff
# https://blog.scottnonnenberg.com/better-git-configuration/
# git difftool master branch
[difftool]
prompt = false
[difftool "icdiff"]
cmd = icdiff --line-numbers $LOCAL $REMOTE
[pager]
difftool = true
[grep]
lineNumber = true
# https://github.com/dandavison/delta/issues/40
# [interactive]
# diffFilter = "delta --dark --file-style plain --hunk-style plain --tabs 2"
[alias]
a = add
ad = add
ap = add -p
amend = commit --amend --no-edit
amends = commit --amend --no-verify
ams = commit --amend --no-verify
co = checkout
both = diff HEAD
b = branch
br = branch
brc = !"git fetch -p; for branch in $(git branch -vv --no-color | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done"
brm = !"git branch --merged | grep -v \"\\*\" | grep -v \"^[^/]\\+$\" | xargs -n 1 git branch -d"
cl = clone --recursive
cm = commit -m
cma = commit -a -m
cmm = commit
cmma = commit -a
cms = commit --no-verify -m
cmsa = commit --no-verify -a -m
d = diff
dev = switch develop
dr = !"git dev && git pl"
df = diff
dl = diff HEAD^
fhist = log --follow -p --
filehistory = log --follow -p --
files = show --pretty="" --name-only
fix = !"git commit --fixup $(git rev-list --reverse develop..HEAD | head -1)"
fixc = commit --fixup
fixh = commit --fixup HEAD
fixm = !"git commit --fixup $(git rev-list --reverse main..HEAD | head -1)"
fixms = !"git commit --fixup $(git rev-list --reverse master..HEAD | head -1)"
fix1 = commit --fixup HEAD~1
fix2 = commit --fixup HEAD~2
fix3 = commit --fixup HEAD~3
flog = log --follow -p --
grp = grep --heading --line-number
l = !"git --no-pager lg -n 10"
lg = log --graph --pretty=format:'%C(cyan)%h%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative
lgm = !"git lg --author='Valentin Agachi'"
last = log -n 1
m = switch main
main = switch main
mrg = merge --ff-only
ms = switch master
nb = switch --create
pick = cherry-pick
pl = pull --ff-only --rebase origin
plg = !"git pl && git l"
pls = !"git pull --ff-only --rebase origin; git submodule sync --recursive; git su;"
po = !"git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)"
prune = fetch --prune
ps = push origin HEAD
psf = push -f origin HEAD
prod = switch production
rb = for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ --count=10
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format=\"%(refname:short)\"
reset = checkout --
reup = !"git fetch upstream main && git mrg upstream/main"
reupms = !"git fetch upstream master && git mrg upstream/master"
rs = checkout --
rbc = rebase --continue
rbi = rebase --interactive
rbim = rebase --interactive --autosquash main
rbimm = !"git main && git pl && git switch - && git rbim"
rbims = rebase --interactive --autosquash master
rbid = rebase --interactive --autosquash develop
rbidd = !"git dr && git switch - && git rbid"
rbms = rebase master
rbdv = rebase develop
s = status -s
sa = stash apply
sd = stash drop
showw = difftool HEAD~1 HEAD
sl = stash list
ss = stash save
st = status
su = submodule update --init --recursive
sta = diff --cached
staged = diff --cached
sw = switch
undo = reset --soft HEAD^
undoit = !"git undo && git unstage . && git rs ."
unsta = reset HEAD
unstage = reset HEAD
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f