-
Notifications
You must be signed in to change notification settings - Fork 10
/
config
217 lines (180 loc) · 5.95 KB
/
config
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
#-----------------------------------------------------------------------------------------#
# This is a git config file that is symlinked into ~/.gitconfig with my dotfiles.
# Authorship: Basically copied from https://github.com/rafi/.config/blob/master/git/config
# Structure: common options at the top, less common at the bottom
#------------------------------------------------------------------------------------------#
[user]
name = Ivan Smirnov
email = [email protected]
[push]
default = current
followTags = true
recurseSubmodules = check # See: https://stackoverflow.com/questions/5814319/git-submodule-push
autoSetupRemote = true # https://stackoverflow.com/questions/6089294/how-to-avoid-having-to-do-git-branch-set-upstream-and-instead-default-to-au
[init]
templatedir = ~/.dotfiles/git/template
defaultBranch = master
[core]
whitespace = trailing-space,space-before-tab
excludesfile = ~/.dotfiles/git/ignore
editor = vim
#------------------------------------------------------------#
# Less common config, will likely remain the same for years.
#------------------------------------------------------------#
[advice]
statusHints = false
pushNonFastForward = false
# source: https://blog.scottnonnenberg.com/better-git-configuration/
# Guide: https://diamantidis.github.io/2018/11/10/save-time-with-git-aliases
[alias]
prune = fetch --prune
undo = reset --soft HEAD^
d = difftool
reword = commit --amend
fuck = reset --hard
amend = commit --amend --no-edit
wip = !git add --all && git commit -am 'wip'
popwip = !git log -1 --pretty=%B | grep -q '^wip$' && git reset HEAD^ || echo 'HEAD is not a wip commit'
pt = !git tag -l | xargs git tag -d && git fetch -t # prune tags.
root = rev-parse --show-toplevel
rt = !git fetch origin tip:tip | git rebase tip
unstage = reset HEAD --
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
today = !git log --all --since=00:00:00 --oneline --no-merges --author=${1-$(git config user.email)}
alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /
[branch]
sort = authordate
autosetuprebase = always
autosetupmerge = always
[browser "google-chrome-stable"]
cmd = "/usr/bin/google-chrome-stable"
[color]
ui = true
pager = true
showbranch = true
diff = auto
status = auto
branch = auto
interactive = auto
[color "branch"]
plain = yellow
current = magenta bold
local = blue bold
remote = white
[color "diff"]
plain = normal
meta = yellow
frag = magenta bold
func = yellow ul
old = red bold
new = green bold
commit = yellow bold
whitespace = red reverse
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "status"]
header = black bold
added = green bold
changed = red
untracked = blue bold
branch = green bold
nobranch = red
[delta]
features = side-by-side line-numbers decorations
whitespace-error-style = 22 reverse
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
[diff]
algorithm = histogram
colorMoved = default
context = 10
mnemonicprefix = true # [i]ndex, [w]ork tree, [c]ommit, [o]bject
renames = copies
submodule = log
tool = vimdiff
[fetch]
# https://spin.atomicobject.com/2020/05/05/git-configurations-default/
prune = true
prunetags = true
fsckobjects = true
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[grep]
lineNumber = true
[help]
autocorrect = immediate
[interactive]
diffFilter = delta --color-only
[merge]
stat = true
tool = vimdiff
conflictstyle = diff3
[merge "ours"]
driver = true
[mergetool]
prompt = false
[pretty]
default = %C(bold black)%h%Creset -%C(auto)%d%Creset %s %C(bold black)(%an %ar)%Creset
detailed = format:%C(cyan)%h %C(red)%ad %C(blue)[%an]%C(magenta)%d %C(white)%s
shorter = %C(auto)%D %C(black)--%C(bold black)%gD%N %ad by %C(white)%cn%C(reset)
vtree = %C(bold blue)%h%C(reset)+%C(bold black)(%cr)%C(reset)+%C(auto)%D%C(reset)++\n+++ %C(bold black)%an%C(reset)%C(black):%C(reset) %s
[pull]
# https://spin.atomicobject.com/2020/05/05/git-configurations-default/
rebase = true
[receive]
fsckObjects = true
[status]
submoduleSummary = true
[submodule]
recurse = true
[transfer]
fsckobjects = true
## Custom git identies based on project path
[includeIf "gitdir:${GIT_PROJECTS_DIR}/elude/"]
path = ~/.dotfiles/git/config-elude
[includeIf "gitdir:${GIT_PROJECTS_DIR}/devzero/"]
path = ~/.dotfiles/git/config-devzero
[includeIf "gitdir:/home/vania/Projects/2.Clients/devzero/"]
path = ~/.dotfiles/git/config-devzero
; [includeIf "gitdir:~/work/"]
; path = .gitconfig-work
# https://mislav.net/2013/02/merge-vs-rebase/
# TODO: Pick a merging model for my downstream projects.
[rebase]
autoStash = true
autoSquash = true # use with 'git commit --fixup OLD_COMMIT_ID'
[remote "origin"]
tagopt = --tags
[rerere] # See rerere docs at https://git-scm.com/blog/2010/03/08/rerere.html
enabled = true
[status]
showUntrackedFiles = all
[web]
browser = google-chrome-stable
# Disable, since this breaks zsh plugin managers
# Include SSH overrides, saved in separate file so that we can easily toggle
#[include]
# path = ~/.dotfiles/git/config-ssh-override
# Allow local customizations in the .gitconfig_local file
[include]
path = ~/.gitconfig_local
[safe]
directory = *
[safe]
directory = /mnt/data1/Personal/Projects/
directory = /mnt/data1/Personal/Projects/elude/elude-github-export/monorepo
directory = /mnt/data1/Personal/Projects/elude/elude-github-export/elude-ios-app
[credential "https://github.com"]
helper =
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/usr/bin/gh auth git-credential