-
Notifications
You must be signed in to change notification settings - Fork 7
/
.gitconfig
218 lines (174 loc) Β· 6.34 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
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
# vim: commentstring=#%s
[user]
name = disrupted
email = [email protected]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID86PP2HgHDD3TMWiW/Y4CD2YXbYYRd6aFer1EL/TnnS
[github]
# GitHub username for cli
user = disrupted
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = red
# workaround for git add --patch being broken
[add "interactive"]
useBuiltin = false
[log]
decorate = auto
abbrevCommit = true
[init]
defaultBranch = main
[status]
short = true
branch = false
[fetch]
prune = true
[push]
# Push to the set upstream branch being tracked by default.
default = current
autoSetupRemote = true
[pull]
# Default to rebasing on pulls
rebase = true
# ff = only
[gpg]
format = ssh
[gpg "ssh"]
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
allowedSignersFile = ~/.ssh/allowed_signers
[commit]
gpgsign = true
[core]
pager = delta # or bat
# Exclude everything this file. Used for general exclusions.
excludesFile = ~/.gitignore
# Set attributes on files. Used for general diff improvements.
attributesfile = ~/.gitattributes
# Don't prompt for commit messages for merge commits.
mergeoptions = --no-edit
commitGraph = true
[diff]
tool = Kaleidoscope # or diffsitter
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path "$MERGED" -- "$LOCAL" "$REMOTE"
[difftool "diffsitter"]
cmd = diffsitter "$LOCAL" "$REMOTE"
[merge]
tool = Kaleidoscope
conflictstyle = zdiff3
[rerere]
enabled = true
[mergetool]
keepBackup = false
prompt = true
[mergetool "nvimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[help]
# Autocorrect mistyped commands.
autocorrect = 1
[interactive]
diffFilter = delta --color-only
[delta]
paging = auto
line-numbers = true
syntax-theme = OneDark
whitespace-error-style = 22 reverse
minus-style = syntax "#402529"
minus-emph-style = syntax "#662F33"
plus-style = syntax "#29342A"
plus-emph-style = syntax "#3B5134"
hunk-header-style = syntax bold
hunk-header-decoration-style = "#4b5263" box
file-style = white bold
file-decoration-style = "#4b5263" ul
line-numbers-zero-style = "#4b5263"
line-numbers-left-format = "{nm:^4} "
line-numbers-right-format = "{np:^4} "
line-numbers-minus-style = "#e06c75" # onedark green
line-numbers-plus-style = "#98c379" # onedark red
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
[apply]
# Cleanup whitespace by default when apply patches.
whitespace = fix
[rebase]
# Run `git stash` if needed before a `git rebase`
autoStash = true
# Auto-add `--autosquash` to `git rebase`
autoSquash = true
[url "[email protected]:"]
# Use SSH for GitHub instead of https://
# Enable this in networks where https:// has issues.
insteadOf = https://github.com/
[credential]
# Use macOS Keychain to store HTTP passwords.
helper = osxkeychain
[hub]
# Use HTTPS rather than SSH protocol in Hub
protocol = https
[alias]
# Show all of my configured aliases
aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
branches = branch -a --sort=-authordate
# delete all local branches that have been deleted/merged on the remote
cleanup = "!git branch -D $(git for-each-ref --format '%(refname:strip=2) %(upstream:track)' refs/heads | awk '$2 == \"[gone]\" {print $1}')"
# NOTE: alternative
# cleanup = "!git fetch --prune && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | gawk '{print $1,$4}' | grep 'gone]' | gawk '{print $1}'); do git branch -D $branch; done"
stashes = stash list
remotes = remote -v
tags = tag --list
conflicts = !git --no-pager diff --name-only --diff-filter=U | xargs grep -c '^=======$'
# Get name of default remote
upstream = !git remote | egrep -o '(upstream|origin)' | tail -1
# Get name of default head branch
main = !git remote show $(git upstream) | awk '/HEAD branch/ {print $NF}'
unstage = reset -q HEAD --
uncommit = reset --mixed HEAD~
# Repeat last commit message
recommit = commit --reuse-message=HEAD
# Create new branch off of default origin branch (origin/master or origin/main)
newbranch = "!f() { [[ -n $@ ]] && git fetch origin && git switch -c \"$@\" origin/$(git main) && git branch --unset-upstream; }; f"
bclone = clone --bare
# Delete local branches that no longer exist on the remote
gone = !git fetch -p && git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D
# Open repository in the browser
open = "!open $(git remote get-url origin)"
# Rebase interactive for all commits on feature branch
rebase-branch = !git rebase -i `git merge-base master HEAD`
# preferred git log view
lg = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(white)%s%C(reset) %C(dim white)-%C(reset) %ar %C(dim white)<%an>%C(reset)%C(auto)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(white)%s%C(reset) %C(dim white)-%C(reset) %ar %C(dim white)<%an>%C(reset)%C(auto)%d%C(reset)%n' --all --stat
# View the log and diff for a commit (previous if no SHA1 provided)
details = log -n1 -p --format=fuller
# when Git loses upstream tracking branch (haven't figured out why exactly) run:
# git set-upstream
# git pull
set-upstream = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`
root = rev-parse --show-toplevel
[includeIf "gitdir:~/bakdata/"]
path = ~/bakdata/.gitconfig
[include]
path = ~/.gitconfig_private