-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitconfig
192 lines (156 loc) Β· 4.87 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
# local/private config goes in the include
[include]
path = ~/.gitconfig-local
[includeIf "gitdir/i:~/code/private/"]
path = ~/code/private/.gitconfig-personal
[includeIf "gitdir/i:~/code/scratch/"]
path = ~/code/scratch/.gitconfig-local
[includeIf "gitdir/i:~/code/work/"]
path = ~/code/work/.gitconfig-work
[includeIf "gitdir/i:~/code/ghedr/"]
path = ~/code/ghedr/.gitconfig-ghedr
[includeIf "gitdir/i:~/code/microsoft/"]
path = ~/code/microsoft/.gitconfig-msft
[init]
defaultBranch = main
# [http]
# sslVerify = false
[protocol]
version = 2
[remote "origin"]
prune = true
pruneTags = true
[gpg]
# program = /opt/homebrew/bin/gpg
format = ssh
[commit]
gpgsign = true
[tag]
forceSignAnnotated = true
[color]
diff = auto
status = auto
branch = auto
ui = auto
[color "branch"]
current = cyan reverse
local = yellow bold
remote = green bold
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = cyan bold
[core]
autocrlf = input
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
filemode = false
attributesfile = ~/.gitattributes
editor = code --wait
pager = ""
[apply]
whitespace = nowarn
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool "icdiff"]
# https://github.com/jeffkaufman/icdiff
cmd = icdiff -N -U 2 $LOCAL $REMOTE
[diff "zip"]
textconv = unzip -c -a
[diff "pandoc"]
textconv=pandoc --to=markdown
prompt = false
[merge]
tool = Kaleidoscope
[mergetool]
keepBackup = false
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
[help]
autocorrect = 50
[fetch]
prune = true
pruneTags = true
[pull]
rebase = true
[push]
# See `git help config` (search for push.default)
# for more information on different options of the below setting.
#
# Setting to git 2.0 default to surpress warning message
default = simple
autoSetupRemote = true
# gpgsign = if-asked
[rebase]
autoStash = true
[pretty]
changelog = * %h %s
# info = %C(auto)%h %G? %d %s
info = %C(auto)%h %d %s
json = {\"sha\":\"%H\",\"author\":{\"userid\":\"%aN\",\"email\":\"%aE\",\"date\":\"%as\"},\"commiter\":{\"userid\":\"%cN\",\"email\":\"%cE\",\"date\":\"%cs\"},\"message\":\"%s\",\"tree_sha\":\"%T\",\"parents\":\"%P\"}
[alias]
# View abbreviated SHA, description, and history graph
l = log --oneline --decorate --graph --abbrev-commit --all --date=relative -n 20
lf = log --pretty=info --graph --first-parent HEAD -n 20
lg = log --pretty=info --graph --all -n 20
loj = !git log --pretty=json -n 10 | jq -sc
lol = log --oneline --graph --decorate --all
# View the current working tree status using the short format w/ branch info
# upgrade your git if -sb breaks for you. it's fun.
s = status -sb
# Show verbose output about tags, branches or remotes
# tags = tag -l
tags = log --no-walk --tags --pretty=info --decorate=full
tag = tag -s
branches = branch -avv
remotes = remote -v
# http://haacked.com/archive/2014/07/28/github-flow-aliases/#completing-the-pull-request
up = pull --rebase --prune
co = checkout
cob = switch -c
ec = config --global -e
# show who you are committing as
# https://gist.github.com/loranallensmith/0350db8a91578f40e471d322cf244d45
me = !git config --show-scope --show-origin --get user.name && git config --show-scope --show-origin --get user.email
idiff = difftool -t icdiff
# https://github.com/ahmadawais/Emoji-Log
# https://gitmoji.dev/
wip = stash -u -m "WIP"
rlz = "!f() { git commit -S -m \"π $1\"; git tag \"$1\" -m \"$1\" -s; }; f"
# worktrees
wt = worktree
wtl = worktree list
wtr = worktree remove
# add a worktree for a new local branch
# git worktree add -b <branch> <path>
wtb = "!f() { git worktree add -b ${1} ${2}; }; f"
# add a worktree for an existing local branch
# git worktree add --checkout <branch> <path>
wtc = "!f() { git worktree add --checkout ${1} ${2}; }; f"
# add a worktree for an existing upstream branch and set up tracking
# git worktree add --track -b <branch> <path> <origin>/<branch>
wtt = "!f() { git worktree add --track -b ${1} ${2} ${3}; }; f"
# https://stackoverflow.com/a/25387310
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
hidden = "!git ls-files -v | grep "^[a-z]""
# https://www.erikschierboom.com/2020/02/17/cleaning-up-local-git-branches-deleted-on-a-remote/#integrating-with-git
gone = ! "git pull && gh poi"
[log]
showSignature = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true