-
Notifications
You must be signed in to change notification settings - Fork 1
/
gitconfig
131 lines (113 loc) · 3.76 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
# vim: ft=gitconfig sw=8
[include]
path = ~/.gitconfig.local
[core]
# Don't introduce any Windows-style line endings
autocrlf = input
[push]
# Safer default push setting (set to squelch warning message)
default = simple
[fetch]
# Remove stale remote references on every fetch or pull
prune = true
[interactive]
# Highlight line differences during interactive staging
diffFilter = $DOTDIR/bin/git-diff-decorate.sh --patch
[diff]
# Even smarter about hunk boundaries (experimental, >=git 2.11)
indentHeuristic = true
# Show full submodule diffs
submodule = diff
algorithm = histogram
[rebase]
# For use with commit --fixup
autosquash = true
# Can rebase with dirty changes
autostash = true
[pager]
# Don't wrap long log lines
log = less -S
# Highlight line differences when shown in a pager
show = $DOTDIR/bin/git-diff-decorate.sh | less
diff = $DOTDIR/bin/git-diff-decorate.sh | less
# Don't page list of branches if they fit on screen
branch = less -FX
[help]
# Automatically use git's "Did you mean...?" after 2 seconds
autocorrect = 20
[advice]
waitingForEditor = false
[color]
# Make sure colors are turned on
ui = true
[color "status"]
untracked = yellow
[color "diff"]
meta = yellow
frag = cyan bold
# TODO: not supported by diff-so-fancy
func = magenta bold
[color "diff-highlight"]
# Background highlight values for base16-shell
oldHighlight = red bold 19
oldReset = normal no-bold black
oldNormal = red
newHighlight = green bold 19
newReset = normal no-bold black
newNormal = green
[stash]
showPatch = true
[alias]
# Complex commands and scripts
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
bclean = !git-clean-merged
# Aliases to git commands
a = add
ap = add --patch
b = branch
bs = branch --sort=-committerdate
c = commit --verbose
ca = commit --verbose --amend
can = commit --amend --no-edit
cf = commit --verbose --fixup
co = checkout
cob = checkout -b
cd = ! bash -c 'db="$(git default-branch)" && git checkout "$db"'
coa = "! git checkout -- $1; git submodule foreach --recursive '[ -f $1 ] && git checkout -- $1 || true'"
# ccd = <see definition in shell/functions>
cpc = cherry-pick --continue
d = diff
ds = diff --staged
dw = diff -w
h = help
l = log --graph --date=relative --pretty=format:'%Cred%>|(16)%h %C(auto)%s%d %Cgreen%ad %C(dim white)%cN%C(nodim)'
mt = mergetool
pfwl = push --force-with-lease
# Note # at the end to avoid using positonal param twice
push-first = "! git push --set-upstream ${1:-origin} $(git symbolic-ref --short HEAD) #"
rc = rebase --continue
rid = ! git rebase -i "$(git default-branch --remote)"
sl = stash list
sp = stash pop
srs = ! git stash save && git rid && git stash pop
ss = stash save
sw = stash show
s = status
su = submodule update --init --recursive
[rerere]
enabled = true
[merge]
tool = diffconflicts
[mergetool]
keepBackup = false
prompt = false
[mergetool "diffconflicts"]
cmd = nvim +DiffConflicts "$MERGED" "$BASE" "$LOCAL" "$REMOTE"
trustExitCode = true
[pull]
ff = only
# Rewrite remote URLS, including submodules, to use SSH protocol
[url "[email protected]:"]
insteadOf = https://github.com/
[init]
defaultBranch = main