-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitconfig
More file actions
247 lines (237 loc) · 9.22 KB
/
Copy path.gitconfig
File metadata and controls
247 lines (237 loc) · 9.22 KB
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
# vim: set noexpandtab:
[color]
ui = true
[alias]
st = status -sb
ci = commit -v
co = checkout
di = diff
dc = diff --cached
amend = commit --amend
a = add -u
aa = add --all
# Add files that are already staged
as = !git add $(git diff --name-only --cached --relative --diff-filter=d)
ff = merge --ff-only
pullff = pull --ff-only
noff = merge --no-ff
fa = fetch --all
pom = push origin master
b = branch
d = diff -w
ds = diff --stat=160,120
dh1 = diff HEAD~1
di = diff
#Divergence (commits we added and commits remote added)
div = divergence
#Goodness (summary of diff lines added/removed/total)
gn = goodness
gnc = goodness --cached
# Fancy logging
# h = head
# hp = head with patch
# r = recent commits, only current branch
# ra = recent commits, all reachable refs
# l = all commits, all reachable refs
head = !git l -1
h = !git head
hp = "!/bin/bash -c 'source ~/.githelpers && show_git_head'"
r = !git l -30
ra = !git r --all
; l = "!/bin/bash -c 'source ~/.githelpers && pretty_git_log'"
l = log --pretty=format:'%C(yellow)%h %C(blue)%<(20,trunc)%aE%C(reset) %<(80,trunc)%s'
la = !git l --all
lc = rev-parse HEAD
ctags = !.git/hooks/ctags
standup = log --since=yesterday --author 'ecerulm\\|ruben\\|Ruben'
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
purr = pull --rebase
ready = rebase -i @{u}
# default-branch helper: prints whatever origin/HEAD points to (main / master / trunk).
# Falls back to "main" if origin/HEAD isn't set locally — run `git remote set-head origin -a` to fix.
default-branch = !sh -c 'b=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null) && echo "${b#origin/}" || echo main' -
rebasebranch = !git rebase -i $(git merge-base HEAD "$(git default-branch)")
fold = !sh -c '_CURRENT_BRANCH=$(git symbolic-ref --short HEAD) && git checkout "${1-$(git default-branch)}" && git merge --no-ff "${2-$_CURRENT_BRANCH}"' -
undomerge = reset --merge ORIG_HEAD
# Diff HEAD against a base ref (default: origin/<default-branch>).
# Usage: git diffbase -> diff against origin/main (or whatever the remote default is)
# git diffbase origin/foo -> diff against origin/foo
diffbase = !sh -c 'cd "${GIT_PREFIX:-.}" && base="${1:-origin/$(git default-branch)}" && git diff "$(git merge-base HEAD "$base")" "$base"' -
pristine = !sh -c 'git reset --hard $1 && git clean -qdfx && git status' -
# Diff the current branch against its fork point from the remote default branch.
diffdefault = !git diff $(git merge-base --fork-point "$(git default-branch)")
# From https://robots.thoughtbot.com/streamline-your-git-workflow-with-aliases
c = commit -m
cob = checkout -b
# These rebase against whatever the remote's default branch is (main / master / trunk).
up = !git fetch origin && git rebase "origin/$(git default-branch)"
ir = !git rebase -i "origin/$(git default-branch)"
done = !sh -c 'b=$(git default-branch) && git fetch && git rebase "origin/$b" && git checkout "$b" && git merge @{-1}' -
god = log --graph --oneline --decorate
track = "!f() { ([ $# -eq 2 ] && ( echo \"Setting tracking for branch \" $1 \" -> \" $2;git branch --set-upstream $1 $2; ) || ( git for-each-ref --format=\"local: %(refname:short) <--sync--> remote: %(upstream:short)\" refs/heads && echo --Remotes && git remote -v)); }; f"
recheckout = "!f() { git read-tree --reset -u $(git mktree </dev/null); git read-tree --reset -u HEAD; }; f"
# difftool diffstastic
dft = difftool
dlog = "!f() { GIT_EXTERNAL_DIFF=difft git log -p --ext-diff $@;}; f"
# remote local branch with no remote branches / delete local branches that has been deleted from remote
dlocal = "!f() { git fetch --prune; git for-each-ref --format='%(if:equals=[gone])%(upstream:track)%(then)%(refname:short)%(end)' refs/heads | xargs git branch -D; echo "Deleted local branches where the upstream is deleted"; }; f"
dmerged = "!f() { git branch --merged origin/main | grep -v '^..main$' | grep -v '^*' | xargs -r git branch -d;}; f"
# sort files by modification time
ls = "!f() { cd -- \"${GIT_PREFIX:-.}\"; git ls-tree -r --name-only HEAD -z \"${1:-.}\" | xargs -0n1 -I{} git --no-pager log -n 1 --format=\"%ad {}\" --date=unix -- {}|sort -n -k1| cut -d ' ' -f 2| xargs -n1 -I{} git log --date=relative -n 1 --format=\"%ad {}\" -- {}; }; f"
lsr = "!f() { cd -- \"${GIT_PREFIX:-.}\"; git ls-tree -r --name-only HEAD -z \"${1:-.}\" | xargs -0n1 -I{} git --no-pager log -n 1 --format=\"%ad {}\" --date=unix -- {}|sort -r -n -k1| cut -d ' ' -f 2| xargs -n1 -I{} git log --date=relative -n 1 --format=\"%ad {}\" -- {}; }; f"
root = rev-parse --show-toplevel
initialcommit = rev-list --max-parents=0 HEAD
[merge]
tool = vscode
stat = true
conflictStyle = zdiff3
[http]
sslVerify = true
[core]
editor = ~/opt/nvim/bin/nvim
excludesfile = ~/.gitignore
autocrlf = false
safecrlf = warn
longpaths = true
pager = delta
untrackedcache = true
fsmonitor = true
[init]
defaultBranch = main
[pager]
difftool = true
[push]
default = current
followTags = true
autoSetupRemote = true
useForceIfIncludes = true
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[diff]
mnemonicprefix = true
renames = copies
tool = difftastic
submodule = log
[http "https://gopkg.in"]
followRedirects = true
[difftool "filemerge"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
[credential "https://git-codecommit.eu-north-1.amazonaws.com"]
provider = generic
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool "difftastic"]
cmd = difft "$LOCAL" "$REMOTE"
[difftool]
prompt = false
trustExitCode = true
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[mergetool]
prompt = false
keepBackups = false
[mergetool "diffmerge"]
trustExitCode = true
path = /usr/local/bin/diffmerge
cmd = diffmerge --merge --caption $(basename $MERGED) -t1=FROM_BRANCH -t2=MERGED -t3=DEST_BRANCH --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
[mergetool "kdiff3"]
path = /usr/local/bin/kdiff3
cmd = kdiff3 --L1 \"FORKPOINT\" --L2 \"SOURCE_BRANCH\" --L3 \"DESTINATION_BRANCH\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
trustExitCode = true
[mergetool "opendiff"]
path = /usr/bin/opendiff
cmd = "opendiff \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" "
trustExitCode = false
[mergetool "meld"]
path = /usr/local/bin/meld
cmd = "meld --auto-merge \"$LOCAL\" \"$BASE\" \"$REMOTE\" --output \"$MERGED\" "
trustExitCode = false
[gpg]
program = /opt/homebrew/bin/gpg
format = ssh
[commit]
gpgsign = true
[pull]
rebase = true
autoStash = true
[interactive]
diffFilter = delta --color-only
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = 11
frag = magenta bold
func = 146 bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse
[fetch]
prune = true
writeCommitGraph = true
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[rerere]
enabled = true
[column]
ui = auto
[branch]
sort = -committerdate
autoSetupMerge = false
[include]
; need to be git 1.9.2 for includes to work
; path = .gitconfig_platform_specific
path = ~/.gitconfig.thismachine
[includeIf "gitdir:~/git/personal/"]
path = ~/git/personal/.gitconfig
[includeIf "gitdir:~/git/work/"]
path = ~/git/work/.gitconfig
[includeIf "gitdir:~/git/foss/"]
path = ~/git/foss/.gitconfig
[tag]
gpgsign = true
[rebase]
updateRefs = true
autoStash = true
autoSquash = true
[user]
name = Rubén Laguna
signingkey = ~/.ssh/id_ecdsa_sk_rk_signing.pub
[blame]
showEmail = true
coloring = highlightRecent
; coloring = repeatedLines
date = relative
[color "blame"]
highlightRecent = 237, 20 month ago, 238, 19 month ago, 239, 18 month ago, 240, 17 month ago, 241, 16 month ago, 242, 15 month ago, 243, 14 month ago, 244, 13 month ago, 245, 12 month ago, 246, 11 month ago, 247, 10 month ago, 248, 9 month ago, 249, 8 month ago, 250, 7 month ago, 251, 6 month ago, 252, 5 month ago, 253, 4 month ago, 254, 3 month ago, 231, 2 month ago, 230, 1 month ago, 229, 3 weeks ago, 228, 2 weeks ago, 227, 1 week ago, 226
[delta]
navigate = true
dark = true
[mergetool "vscode"]
cmd = code --wait --merge \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
trustExitCode = false
[credential "https://github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !/opt/homebrew/bin/gh auth git-credential
[gpg "ssh"]
allowedSignersFile = ~/.config/git/allowed_signers
program = ~/.local/bin/ssh-keygen-enclave
# ssh-keygen-enclave sets SSH_SK_PROVIDER=/usr/lib/ssh-keychain.dylib and
# runs /usr/bin/ssh-keygen, THEN re-verifies its own -Y sign output with the
# public key and exits non-zero if it doesn't verify. Needed because when
# Touch ID is unavailable (lid closed / clamshell) Apple's ssh-keychain.dylib
# returns "success" with an all-zero ECDSA (r,s); plain ssh-keygen wraps that
# in valid SSHSIG armor and exits 0, so git would record an unverifiable
# commit. The self-check makes `git commit` abort instead.