-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdotgitconfig
279 lines (223 loc) · 7.91 KB
/
dotgitconfig
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
[alias]
br = branch
branches = branch -av
# git change-commits GIT_COMMITTER_NAME "old name" "new name"
change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f "
ci = commit
# clean up local, merged branches
cleanup = "!git branch --merged | grep -v master | xargs -n 1 git branch -d"
# cleanup remote, merged branches (origin only)
# for older git versions
# cleanup-remote = "!git branch -r --merged | grep master | sed 's/origin\//:/' | args -n 1 git push origin"
cleanup-remote = "!git branch -r --merged | grep -v "master" | sed 's/origin\\///' | args -n 1 git push --delete origin"
co = checkout
contributors = shortlog --summary --numbered
cp = cherry-pick
df = diff
lg = "!echo 'use `glol` or `glod` instead!'"
logp = "!echo 'use `glgp` instead!'"
remotes = remote -v
# from https://help.github.com/articles/remove-sensitive-data
remove-file = "!f() { git filter-branch -f --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all; }; f "
# view status using short format
s = status -s
st = status
tags = tag -l
undo = reset HEAD~1 --mixed
# git pull with some defaults
up = pull --no-rebase --stat --autostash
reup = pull --rebase --stat --autostash
ffup = pull --ff-only --stat --autostash
# Show the diff of everything you haven't pushed yet
unpushed = "!f() { b=\"$(git rev-parse --abbrev-ref HEAD)\"; git diff \"origin/${b}..HEAD\"; }; f "
# find the top level of current repository
top = rev-parse --show-toplevel
# Skaffold-like build tag for e.g. use as container image tag
id = describe --tags --dirty --always
# Written by Corey Haines
# Scriptified by Gary Bernhardt
# Put into git alias by Dominik Siebel
#
# List churn (edits-over time) to identify where the most time is being spent.
# Idea: https://youtu.be/7hL6g1aTGvo?t=16m53s
#
# Show churn for whole repo:
# $ git churn
#
# Show churn for specific directories:
# $ git churn app lib
#
# Show churn for a time range:
# $ git churn --since='1 month ago'
#
# (These are all standard arguments to `git log`.)
churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
[branch]
autoSetupRebase = always
[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
diff = auto
pager = true
status = auto
branch = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
commit = 227 bold
frag = magenta bold
meta = 227
new = green bold
old = red bold
whitespace = red reverse
[color "diff-highlight"]
newHighlight = green bold 22
newNormal = green bold
oldHighlight = red bold 52
oldNormal = red bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[commit]
# Ensures all commits are signed for improved security and author verification
gpgsign = true
# Shows diff of changes, by file, at the bottom of the commit message
verbose = true
[core]
# Use only the first 12 characters of a commit SHA instead of the full 40 characters
abbrev = 12
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Tells Git where to look for my Dotfiles managed Git Hooks XDG configuration
# FIXME: disabled, because it clashies with pre-commit
# see also: https://github.com/pre-commit/pre-commit/issues/1198
# hooksPath = ~/.config/git/hooks
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# set system editor as default editor
editor = $EDITOR
ignorecase = false
# Use git-delta for proper pagination and syntax highlighting
pager = delta
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
[credential]
helper = osxkeychain
[delta]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
hunk-header-decoration-style = yellow box
line-numbers = true
minus-color = "#340001"
navigate = true # use n and N to move between diff sections
plus-color = "#012800"
side-by-side = true
whitespace-error-style = 22 reverse
[diff]
algorithm = histogram
colorMoved = default
indentHeuristic = true
mnemonicprefix = true
renames = copies
srcPrefix = before
[difftool]
prompt = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
required = true
process = git-lfs filter-process
[fetch]
prune = true
pruneTags = true
writeCommitGraph = true
[gpg]
format = ssh
[gpg "ssh"]
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
[grep]
column = true
fullname = true
lineNumber = true
[help]
autocorrect = 30
[init]
defaultBranch = main
templateDir = ~/.config/git/template
[interactive]
# Ensures Delta is used to handle the diff filter for interactive commands
diffFilter = delta --color-only
# Ensures only a single key is used without having to hit enter for interactive commands
singleKey = true
[maintenance]
auto = false
strategy = incremental
[merge]
# See what is on HEAD, what is common, and what is local
conflictstyle = zdiff3
# Ensures no extra commit is made when merging
ff = only
# Include summaries of merged commits in newly created merge commit messages
log = true
# Always show a diffstat at the end of a merge
stat = true
[mergetool]
prompt = false
[notes]
# Ensures notes are not lost when rebasing
rewriteRef = refs/notes/commits
[pack]
# Ensures bitmaps are used for improved index traversal performance.
useBitmapBoundaryTraversal = true
[pull]
# Enforces a Git Rebase workflow instead of the default merge workflow when pulling.
rebase = merges
default = current
[push]
# Assume that the current branch is set upstream (i.e. same name as branch)
autoSetupRemote = true
default = simple
# Ensures you can’t force push changes to remote branch if commit history doesn’t have same parent.
# This is extremely handy for preventing obliteration of remote changes if the histories don’t align
# especially in rare cases your local branch managed to get misaligned with the remote branch.
# useForceIfIncludes = true
[rebase]
# Ensures each rebase automatically moves fixup!, squash!, and amend! commits
# to their corresponding commit for reduced manual labor
autoSquash = true
# Ensures untracked, modified, or staged files are automatically pushed
# onto the stash before a rebase and auto-popped after the rebase completes.
autoStash = true
# Ensures any branches, which references the same commits, are automatically
# rebased along with the current branch being rebased.
updateRefs = true
[rerere]
# Ensures the rerere cache is automatically updated when resolving
# a rebase conflict for improved rebase speed.
autoUpdate = true
# Ensures Reuse Recorded Resolution (rerere) is enabled for an improved
# rebase workflow so you can reduce the number of times you have to resolve
# the same conflict when rebasing multiple times.
enabled = true
[status]
# Ensures all untracked files in all directories are shown.
showUntrackedFiles = all
[tag]
# Ensures tags are always cryptographically signed like commits
gpgSign = true
# Ensures repository tags are sorted by version.
sort = version:refname
[url "ssh://[email protected]/"]
insteadOf = https://github.com/
[user]
name = Dominik Siebel
email = [email protected]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICH7LJ5wAIWlKhsOgmkAC5E2s7A7Bs7+etEO1vFRw/nz
# Ensures Git never attempts to guess user email and name from the local system but uses your configuration instead.
useConfigOnly = true