-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
158 lines (125 loc) · 3.13 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
# vim: set syntax=gitconfig:
[include]
# user configuration
path = ~/.gitid
;[includeIf "gitdir:/home/allgreed/Work/"]
;# work configuration
;path = ~/.gitwork
[core]
pager = less
excludesfile = ~/.gitignore_global
attributesfile = ~/.gitattributes_global
autocrlf = input
safecrlf = true
untrackedCache = true
[fetch]
prune = true
fsckobjects = true
[transfer]
fsckobjects = true
[receive]
fsckObjects = true
# TODO: if I have 2 same blocks, like if I split push into 2 -> will they be merged or would last win?
[push]
default = simple
followTags = false
recurseSubmodules = check
autoSetupRemote = true
[pull]
ff = only
[merge]
conflictstyle = zdiff3
[rebase]
autosquash = true
missingCommitsCheck = error
[commit]
verbose = true # -v
[rerere]
enabled = true
# yes, it's a statement
[init]
defaultBranch = master
[safe]
# since I rarely use bare repos on my terminal machines
# this mitigates an obscure attack vector
# https://github.com/jwilk/git-landmine
bareRepository = explicit
# it's owned by root but I want the git indicator in the promt to work properly anyway
directory = /etc/nixos
# huh?
[advice]
addIgnoredFile = false
addEmptyPathspec = false
# 3rd party
############################
[hub]
protocol = ssh
[url "[email protected]:"]
pushInsteadOf = https://github.com/
# Diffs
############################
[diff]
renames = copies
algorithm = histogram
colormoved = "default"
colormovedws = "allow-indentation-change"
[diff "bin"]
textconv = hexdump -v -C
[difftool]
prompt = false
[difftool "nvimdiff"]
cmd = nvim -d $LOCAL $REMOTE
# UI
############################
[branch]
sort = -committerdate
[sort]
sort = taggerdate
[log]
date = human
[alias]
a = add
c = commit
d = diff
dw = diff --word-diff
p = push
s = status --short
aa = a --all
call = "!f() { git diff-index --quiet --cached HEAD -- && git aa && git c $@ || echo 'Aborting! Index dirty or something went wrong'; }; f"
co = checkout
dc = d --cached
dcw = dw --cached
dwc = dcw
cam = !git call -C HEAD --amend
pforce = push --force-with-lease
cof = !git for-each-ref --format='%(refname:short)' refs/heads | fzf | xargs git co
purge-branches = !git-purge-branches
crypt = !git-crypt
serve = daemon --reuseaddr --base-path=. --export-all --verbose
[color "status"]
added = green
changed = blue
untracked = red
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red
new = green
[color "branch"]
current = yellow reverse
local = yellow
remote = cyan
# Filters
############################
[filter "kicad_project"]
clean = sed -E 's/^update=.*$/update=Date/'
smudge = cat
[filter "kicad_sch"]
clean = "sed -E 's/#(PWR|FLG)[0-9]+/#\\1?/'"
smudge = cat
[filter "workrave_config"]
clean = "~/.scripts/filter-workrave-git clean"
smudge = "~/.scripts/filter-workrave-git smudge"
[filter "taskwarrior_ignore_set_context"]
clean = grep -v '^context='
smudge = cat