-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_gitconfig
291 lines (221 loc) · 7.39 KB
/
dot_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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# Git config for all repositories inside of work/
[includeIf "gitdir:**/repos/work/**"]
path = ~/.gitconfig-work
[includeIf "gitdir:**/repos/work/**"]
path = ~/.git-send-email-work.conf
# Git config for all repositories inside of personal/
[includeIf "gitdir:**/repos/personal/**"]
path = ~/.gitconfig-personal
[includeIf "gitdir:~/Dropbox/**"]
path = ~/.gitconfig-personal
[includeIf "gitdir:~/.local/share/chezmoi/**"]
path = ~/.gitconfig-personal
[user]
name = Javier Tia
[safe]
directory = *
[init]
defaultBranch = main
[alias]
# Print the name of the current branch
current = symbolic-ref --short HEAD
# Logs
lol = log --topo-order --pretty=format:'%C(green)%h%C(reset) %s%C(red)%d%C(reset)'
lg = log --topo-order --pretty=format:'%C(bold)Commit:%C(reset) %C(green)%H%C(red)%d%n%C(bold)Author:%C(reset) %C(cyan)%an <%ae>%n%C(bold)Date:%C(reset) %C(blue)%ai (%ar)%C(reset)%n%+B'
last = lg -1
# List new commits, of current branch, have been created by last command
# (typically used after a "git pull")
new = "!f() { ref=$(git symbolic-ref --short HEAD); \
git log ${ref}@{1}..${ref}@{0} \"$@\"; }; f"
# Like <git new>, but it accepts branches as parameters, e.g.: git newp
# origin/BRANCH
newp = "!f() { git log ${1}@{1}..${1}@{0} \"$@\"; }; f"
# Update local repo and all submodules
pull-submodules = "!__git_spull() { git pull \"$@\" && \
git submodule sync --recursive && \
git submodule update --init --recursive; }; __git_spull"
# Checkout our changes, leaves/gets theirs changes
ours = "!f() { git checkout --ours -- $@ && git add $@; }; f"
# Checkout theirs changes, leaves/gets ours changes
theirs = "!f() { git checkout --theirs -- $@ && git add $@; }; f"
# Show ours changes
show-ours = !git-show :3:"${1}"
# Show theirs changes
show-theirs = !git-show :2:"${1}"
# Summarizes commits, sort based on numbers commits and show each author
# email
score = shortlog -n -s -e
# For raw patches, a shortcut for a 'normal' diff to save as a patch for
# emailing or later application
patch = !git --no-pager diff --no-color
#
# Editing
#
# Editing/adding conflicted files
edit-unmerged = "!f() { git diff --name-only --diff-filter=U ; }; ${EDITOR} `f`"
add-unmerged = "!f() { git diff --name-only --diff-filter=U ; }; git add `f`"
# Commit any files changes, squash them into the last commit and update
# its date
fixup-prev-ci = !git commit --all --amend --reuse-message=HEAD --date=\"$(date)\"
# list files which have changed
files = !git diff --name-only
dt = "! args=$@; shift $#; nvim -c \"DiffviewOpen $args\""
rE = "!f() { git restore -S $@ && git restore $@; }; f"
# Pull, Rebase, Origin Main branch
update-vs-origin = "!git pull --rebase origin $(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)"
[core]
editor = nvim
# Global gitignore
excludesfile = ~/.gitignore
[i18n]
# Character encoding the commit messages are converted to when running git
# log and friends
logOutputEncoding = utf-8
[merge]
# Extend rename limit
renamelimit = 0
# delta will display diffs between the ancestral commit and each of the two
# merge parents
; conflictstyle = diff3
[help]
# Automatically correct and execute mistyped commands
autocorrect = 1
[push]
# automatically setup an upsteam tracking when you run git push from a new branch
autoSetupRemote = true
[pull]
# Preserve merges when you're rebasing against origin/BRANCH
rebase = merges
[fetch]
# Always prune when fetching and pulling
prune = true
prunetags = true
[branch]
# Rebase against tracking branch
autoSetupRebase = always
# Sort branch by the commit date
sort = -committerdate
[diff]
# Specify the format in which differences in submodules are shown. The
# "log" format lists the commits in the range like git-submodule summary
# does
submodule = log
# Moved lines of code are colored differently
colorMoved = default
colorMovedWS = allow-indentation-change
# Extends patience algorithm to support low-occurrence common elements
algorithm = histogram
[status]
# submodule summary will be enabled and a summary of commits for modified
# submodules will be shown
submoduleSummary = true
[rerere]
# Disable recording of resolved conflicts
enabled = false
[rebase]
# Enable --autosquash option by default
autoSquash = true
# Automatically create a temporary stash before the operation begins, and
# apply it after the operation ends
autoStash = true
# Automatically force-update any branches that point to commits that are
# being rebased
updateRefs = true
[stash]
# Show patch mode when use `git stash show`
showPatch = true
[commit]
# A boolean or int to specify the level of verbose with git commit
verbose = true
# All commits should be GPG signed
gpgsign = true
[format]
# Enable the -s/--signoff option by default in the patches
signOff = true
[interactive]
# Enable single key presses in Interactive Mode
singlekey = true
[grep]
lineNumber = true
patternType = perl
[log]
# display dates as 2023-05-25 13:54:51 instead of Thu May 25 13:54:51 2023
date = iso
# Avoid data corruption
[transfer]
fsckobjects = true
[fetch]
fsckobjects = true
[receive]
fsckObjects = true
[maintenance]
auto = false
strategy = incremental
repo = ~/repos/work/linux-stable
[tag]
sort = version:refname
#
# delta
#
[interactive]
diffFilter = delta --color-only
[core]
# Change to difft when it supports to act as pager
pager = "{ \
COLUMNS=$(tput cols); \
if [ $COLUMNS -ge 80 ] && [ -z $FZF_PREVIEW_COLUMNS ]; then \
delta -w $COLUMNS; \
elif [ $COLUMNS -ge 160 ] && [ ! -z $FZF_PREVIEW_COLUMNS ]; then \
delta -w $FZF_PREVIEW_COLUMNS; \
else \
delta; \
fi \
}"
[delta]
# use n and N to move between diff sections
navigate = true
line-numbers = false
light = false
side-by-side = false
tabs = 4
[pager]
difftool = true
diff = delta
#
# diff tools
#
[difftool]
prompt = false
; difftastic diff tool
[diff]
tool = difftastic
; Wait for more features
; external = difft
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[sequence]
editor = interactive-rebase-tool
[gitreview]
# Gerrit username
username = javier.tia
[credential]
helper = "cache --timeout 21600"
helper = oauth
[credential "https://gitlab.com"]
helper =
helper = !/usr/bin/glab auth git-credential
[maintenance "repack"]
enabled = true
[maintenance "gc"]
enabled = true
[maintenance "commit-graph"]
enabled = true
[maintenance "prefetch"]
enabled = true
[sendemail]
smtpencryption = tls
suppresscc = self
smtpserverport = 587
; smtpServer = /usr/bin/msmtp
; smtpServerOption = -v
# vim:ft=gitconfig ts=4 sw=4