-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmin.gitconfig
358 lines (264 loc) · 14.8 KB
/
min.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
# name =
# email =
[alias]
# Show verbose output about tags, branches or remotes
tags = tag -l
remotes = remote -v
# List and regex-match aliases
aliases = "!f(){ case $1 in ''|-*) arg1= ;; *) arg1=\".$1\"; [ -n \"$arg1\" ] && shift;; esac; git config --get-regexp alias${arg1:-} $@; }; f"
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# Check what git attributes are set for a file
attrs = check-attr --all
# Shorthand for status; nothing special
st = status
# Shorthand for ls-files; nothing special
ls = ls-files
# Be extra careful about what you're getting rid of when using git clean
clean = clean -i
# Effectively equivalent to `git add` for each changed file; mark all files already being tracked by Git as staged.
stage-changed = "!f(){ git add $(git diff --name-only --diff-filter=AM); }; f"
# %(authordate:format:%Y-%m-%d %I:%M %p) : Prints authordate in a format like `2019-10-28 10:13 PM`
### %(authordate:human) : Prints authordate in a format like `Mon Oct 28 22:13`
# %(if)%(HEAD)%(then)* %(else) %(end) : Prefix the current branch with an asterisk
# %(if)%(HEAD)%(then)%(color:green)%(else)%(color:red)%(end)%(refname:short) : Color the current branch green, and all other branches red
branches = for-each-ref --sort=-committerdate --format="\"%(color:blue bold)%(authordate:format:%Y-%m-%d %I:%M %p) %(align:10,right)%(if)%(HEAD)%(then)* %(else) %(end)%(if)%(HEAD)%(then)%(color:green)%(else)%(color:red)%(end)%(refname:short)%(end)\""
# More simplistic "branches"
# branches = branch -a --sort=-committerdate
# Undo the effects of the last commit; reverts all changes to pristine state.
# Extra dangerous for merge commits, where HEAD has multipe parents,
# and this only discards the changes from one parent.
# Use a combination of ~n and ^m to specify which parent(s),
# Where ~n specifies a linear parent, and ^m is a branched parent.
# It's not a very intuitive syntax.
# See https://stackoverflow.com/questions/2221658
undo-destructive = reset --hard HEAD^
# Uncommit the last commit, but retain all changes made in the committed files. Literally just "uncommit"
undo = reset --soft HEAD^
# Unstage one or more files from commit
unstage = restore --staged
# Unstage any and all changes from commit
unstage-all = "!f(){ git unstage $( git diff --cached --name-only ); }; f"
# Print the path of the repository root
root = rev-parse --show-toplevel
diff = diff -w --ignore-blank-lines
# Fetch changes to all submodules
# fullFetch = submodule foreach 'git fetch — all’
# Pull in remote changes for the current repo AND all its submodules
fullPull = pull --recurse-submodules
# Clone a remote repo AND all its submodules
fullClone = clone --recursive
# Show the user email for the current repository.
whoami = config user.email
# Show the git log for the last N commits
last-log = "!f(){ arg1=\"$1\"; [ -n \"$arg1\" ] && shift; git log -n ${arg1:-1} $@; }; f" # <N>
# Show git log, with a summary of each commit, list which files a commit touched
# and classify the change using one (or more?) characters according to the following:
# Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R),
# have their type (i.e. regular file, symlink, submodule, etc) changed (T),
# are Unmerged (U), are Unknown (X), or have had their pairing Broken (B)
# The case block here is responsible for changing behavior according to whether the first argument is a positive integer (and doesnt start with a '0'),
# a possible flag (starts with a dash '-'), or an empty string (or no argument at all). Any errors thrown are still from Git.
flog = "!f(){ case $1 in ''|-*) arg1= ;; 0*|[!0-9]*) arg1= ;; *) arg1=\"$1\"; [ -n \"$arg1\" ] && shift;; esac; git log --name-status -n ${arg1:-1} $@; }; f"
# Formatted log graph showing all branches
grog = log --graph --abbrev-commit --decorate --all --format="\"%C(bold blue) %h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\""
# git grog, but only for a single branch
bgrog = log --graph --abbrev-commit --decorate --format="\"%C(bold blue) %h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\""
# Show the change history of one or more specific files, including both commit messages and diff
filehist = log --follow -p
# Remove a file from the local repository index (and unstage it) without deleting the file itself; Follow this with a commit and push.
# Note that the file in question MUST also be added to .gitignore to prevent changing/deleting the local file during future merges/pulls.
# Afterwards, local changes to the file should no longer be tracked by git.
# Also see https://stackoverflow.com/a/21477287
rmFromIndex = rm --cached
# Stash all files, including files ignored or not yet tracked by git
stash-all = stash push --all
# Create a local branch without specifying a remote branch for it to track, nor allowing the implicit creation of a remote branch of the same name
local-only-branch = branch --no-track
# Something with git-icdiff has been misbehaving following an update I did, seemingly causing it to misinterpret all arguments. This seems to do what I need in the mean time.
jcdiff = "!f(){ case $1 in ''|-*) arg1= ;; *) arg1=\"$1\"; [ -n \"$arg1\" ] && shift;; esac; git difftool --no-prompt --ignore-cr-at-eol --color-moved-ws=ignore-space-at-eol --ignore-space-at-eol --extcmd='"icdiff --is-git-diff -Ns --tabsize 4 --cols=$(tput cols) --strip-trailing-cr"' ${arg1:-} $@; }; f"
# List all files being ignored by standard ignore files.
# Very similar to "fd --no-ignore --exclude '.git' --exec-batch '/usr/lib/git-core/git-check-ignore' '-v' '{}' ';'"
ignoring = ls-files -ico --exclude-standard
# Interactively select changes from files to stage, chunk by chunk
chunk = add -p
# If this doesn't behave properly, try just running 'git difftool --dir-diff --tool=meld' directly. ARGUMENT ORDERING MAY BE SIGNIFICANT! ALSO LAUNCHING IN BACKGROUND WITH A TRAILING &
meld = "!f(){ git difftool --tool=meld --dir-diff \"$@\"; }; f"
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = green
local = dim bold green
remote = red
upstream = magenta
reset = dim cyan
worktree = bold blue
[color "diff"]
whitespace = red reverse
[color "status"]
added = green #files which are added but not committed; AKA updated
changed = red #files which are changed but not added in the index
untracked = yellow #files which are not tracked by Git
unmerged = 202 #files which have unmerged changes between remote and local branch content
branch = 129 #the current branch, somehow not the same as the localBranch color?
#[commit]
#
# # https://help.github.com/articles/signing-commits-using-gpg/
# gpgsign = true
[completion]
# This is only used by git-completion.bash to add or remove commands from the list of completed commands.
# Normally only porcelain commands and a few select others are completed.
# You can add more commands, separated by space, in this variable.
# Prefixing the command with - will remove it from the existing list
commands = ls-files -ls -st check-ignore \
-bundle -format-patch -instaweb -notes -repack -send-email -am
[core]
# Speed up commands involving untracked files such as `git status`.
# https://git-scm.com/docs/git-update-index#_untracked_cache
untrackedCache = true
# I hate when a git command brings up vim, because I can never remember how to exit that, and end up having to look it up >.<
editor = "nano"
# EXPERIMENTAL
fscache = true
symlinks = true
ignorecase = false
whitespace = blank-at-eol,space-before-tab
# Including -F in LESS screws with the man command, but some git commands really should have less auto-exit if the full command output fits on one screen.
# Might as well enforce all the default flags git passes to less when LESS is unset, I guess?
pager = "less -RFX"
#[credential]
#
# # Specify an external helper to be called when a username or password credential is needed;
# # the helper may consult external storage to avoid prompting the user for the credentials.
# # Note that multiple helpers may be defined. See gitcredentials(7) for details.
# # ALSO Note that Git will supposedly try to prepend "git-credential-" to the helper name and look for it in the path.
# # If using git-for-windows, prefer the newer credential-manager, (manager-core) "git-credential-manager-core"
# # If using the git-credential-manager from git-for-windows, set helper to the full WINDOWS path to the executable,
# # i.e. "C:/Program Files (x86)/Git/mingw64/libexec/git-core/git-credential-manager-core.exe"
# helper =
[delta]
features = side-by-side line-numbers
tabs = 4
syntax-theme = Monokai Extended
[delta "line-numbers"]
line-numbers = true
[diff]
# Restrict changes shown to files inside the current directory, and show pathnames relative to that location
relative = true
# Detect copies as well as renames
renames = copies
wsErrorHighlight = all
# Set the default graphical difftool to Meld
guitool = meld
[diff "bin"]
# Use `hexdump` to diff binary files
textconv = hexdump -v -C
# [difftool]
#
# # Prompt before each invocation of the(any) diff tool
# # Default behavior is true.
# prompt = false
[difftool "icdiff"]
# icdiff provides colorized side-by-side diffs on the command line
# Assumes that icdiff is available in PATH
cmd = icdiff -Ns --tabsize 4 --strip-trailing-cr --cols="$(tput cols)" "$LOCAL" "$REMOTE"
#cmd = icdiff -Ns --tabsize 4 --strip-trailing-cr --cols=\"$(tput cols)\" -L '{basename} (OLD)' -L '{basename} (NEW)' $LOCAL $REMOTE
# Still somewhat broken on Windows, sadly. The good news is that the following command does exactly what the cmd SHOULD do:
# git difftool --no-prompt --ignore-cr-at-eol --color-moved-ws=ignore-space-at-eol --ignore-space-at-eol --extcmd="icdiff --is-git-diff -Ns --tabsize 4 --cols=$(tput cols) --strip-trailing-cr"
# Whether to prompt before each invocation of the (any) diff tool.
# Default behavior is true.
prompt = false # I hope this actually works...
[difftool "meld"]
path = meld
cmd = meld "$REMOTE" "$LOCAL" --label='DIFF (Remote <-> Local)' # Left: LOCAL Right: REMOTE
# For some reason, the REMOTE files always seems to insist upon displaying on the OPPOSITE side of the REMOTE directory tree, regardless of ordering of command line arguments or Meld settings.
prompt = false
[grep]
lineNumber = true
#[help]
#
# # Automatically correct and execute mistyped commands
# autocorrect = prompt
[http]
sslVersion = tlsv1.2 # There was a reason not to use tlsv1.3, but I foolishly forgot to make a note explaining it.
[icdiff]
# Used only by git-icdiff script; don't provide the "$LOCAL" "$REMOTE" arguments here.
# Note that --cols should be unneccessary except on Windows, and even then, may not be with the availability of ConPTY
options = -Ns --tabsize 4 --strip-trailing-cr --cols="\"$(tput cols)\""
# Specifically EXCLUDE the -R/--RAW-CONTROL-CHARS flag, as git-icdiff adds that automatically
# The -J/--status-column flag may cause unnecessary line breaks to be added...
pager = less -iJM --tilde --shift .25 --wheel-lines 3 --quit-if-one-screen
[init]
defaultBranch = master
#[interactive]
# diffFilter = delta --color-only
[log]
# Infuriatingly, I am unable to get the date format string to work with any sort of padding
# So even though I have confirmed that strftime can handle (prefixed with a '+') '%b %_2d, %_Y %_2I:%02M %p',
# I am unable to use my preferred date/time format.
#date = format-local:"%b %_2d, %_Y %_2I:%02M %p"
# I suppose I'll have to settle for default-local then
date = default-local
[merge]
# Include summaries of merged commits in newly created merge commit messages; true = 20, false = 0
log = true
# In the event of a conflict, normal behavior is to show 2 sections, one for each of the changes in conflict.
# diff3 changes that behavior to show 3 sections, inserting between the original 2 an additional section showing the content before either of the conflicting changes is applied
conflictStyle = diff3
# Throw errors on merges that aren't fast-forwards; for those cases, you probably want to use 'git rebase -i' to avoid creating a merge commit.
# If you really want to create a merge commit, use 'git merge --ff' explicitly
ff = only
# Set the default graphical mergetool to Meld
guitool = meld
[mergetool]
# Whether to prompt before each invocation of the (any) merge tool.
# Default behavior is true.
prompt = false
[pager]
# # If the value is boolean, turns on or off pagination of the output of a particular Git subcommand when writing to a tty.
# # Otherwise, turns on pagination for the subcommand using the pager specified by the value of pager.<cmd>
blame = less -RF -JM --tilde --shift .25 # paginate the output of the 'log' subcommand using 'less -RF'
log = less -RF -JM --tilde --shift .25 # paginate the output of the 'log' subcommand using 'less -RF'
show = less -RF -JM --tilde --shift .25 # paginate the output of the 'log' subcommand using 'less -RF'
diff = delta # paginate the output of the 'diff' subcommand using 'delta'
#[pretty]
# # Sadly this cannot be used with any of the special field names available for for-each-ref
# # also note that unlike in for-each-ref, colors are applied in the format of %C(colorName [styling]), as opposed to %(color:colorName [styling])
[push]
# # https://git-scm.com/docs/git-config#git-config-pushdefault
# default = simple
# Make `git push` push relevant annotated tags when pushing branches out.
# Generally speaking, you create tags locally with the intention of including them in subsequent pushes.
followTags = true
[status]
showStash = true
## URL shorthands
[url "[email protected]:"]
# Any url starting with "gh:" will be rewritten to start with "[email protected]:" instead
insteadOf = "gh:"
insteadOf = "github.com/"
insteadOf = "http://github.com/"
# Any url starting with "github:" will not be pushed to; when pushing to such an address,
# the url will be rewritten to start with "[email protected]:" instead, and the resulting address will be pushed to instead.
# This does not affect pulling from urls beginning with "github:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
pushInsteadOf = "https://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
#[url "[email protected]:"]
#
# insteadOf = "gst:"
# pushInsteadOf = "gist:"
# pushInsteadOf = "git://gist.github.com/"
#[url "git://gist.github.com/"]
#
# insteadOf = "gist:"
# If using git-for-windows, this is used by the git-for-windows-updater utility script.
[winUpdater]
recentlySeenVersion = 2.30.1.windows.1