-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig1
executable file
·87 lines (86 loc) · 3.31 KB
/
.gitconfig1
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
[include]
path = .gitconfig2
[color]
ui = auto
diff = auto
status = true
interactive = true
pager = true
[push]
default = upstream
# recursesubmodules = check
[pull]
# Git can get majorly stuck if you are too far behind and you try to do a
# rebasing pull, such that it will be unable to pick all the commits you
# would need to catch back up. So by default, simply make a merge-commit
# when pulling from another (remote) branch into local, rather than trying
# to replay current changes over top of whatever was just pulled in:
rebase = false
# ^ Note that you can usually just `git rebase` (by itself) to eliminate
# the extra merge-commit that will appear in your commit-history when you
# `git pull [<remote> <branchName>]` and you're behind. Alternatively, you
# can `git pull --rebase [<source>]` if you know you're in a spot where you
# really want to. Note that the above command is equivalent to always just
# doing `git pull --no-rebase [<source>]`
[log]
# show short commit-hashes under `git log`:
abbrevCommit = true
# ^ This option was added in version 1.7.6.
# For previous versions this gives similar results:
# git config --global format.pretty "format:%C(yellow)%h%Creset
# Author %an: <%ce>
# Date: %cd
#
# %s
#
# "
# Thanks to answers:
# stackoverflow.com/a/11884798/3159183
# stackoverflow.com/a/4820071/3159183
[diff]
submodule = log
algorithm = histogram
# ^ arguably superior to the default Myers and the unmodified Patience
# algorithm (of which histogram is itself a modification), histogram was
# found to be clearer according to arxiv.org/abs/1902.02467 .
# luppeng.wordpress.com/2020/10/10/when-to-use-each-of-the-git-diff-algorithms
# offers some good illustrations of the differences. Probably not as good
# as GitClear's algo, but that's proprietary and ain't nobody got time for
# that.
[merge]
conflictstyle = zdiff3
# ^ recommended by adamj.eu/tech/2023/12/29/git-conflict-display-zdiff3/,
# this causes files with merge-conflicts to indicate the contents of the
# original line or chunk that was altered by different commits in different
# ways, which may make it more obvious which one to accept, or how to
# combine the two. Note this is only available in Git versions 2.35.0 and
# later. Otherwise, you'll need to disable this.
[alias]
# NOTE: In addition to the below aliases, a number of tweaks from define_funcs
# are made to git-commands by shadowing them using a function. (git does not
# allow overriding of builtin commands natively, even if it's just to add
# common flags.)
dif = diff --cached
uno = status -uno
kommit = commit --author='patrickegon@outlook.com'
# this can be used with "`pwd`" as its argument if the repo has changed
# locations or been mounted somewhere else:
rehome = config --path core.worktree
home = rev-parse --show-toplevel
[status]
submodulessummary = 1
[alias "submodule"]
# if a submodule gets added in the current git directory, make sure
# that a recursive check is done on push/pull so that bad things
# don't happen
add = "\
!function f(){ \
if [[ $(git config push.recursesubmodules) == '' ]]; then \
git config push.recursesubmodules check; \
fi \
git submodule add \"$@\" \
} \
f \
echo push.recursesubmodules set to 'check' \
unset -f f"
# ^ TODO: move to define_funcs, since this code is not actually valid here.