/
.gitconfig
130 lines (130 loc) · 4.13 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
[user]
name = Giovanni Bassi
email = giggio@giggio.net
[diff]
indentHeuristic = true
submodule = log
; tool = vsdiffmerge
tool = codediff
[merge]
; tool = vsdiffmerge
tool = codediff
[difftool "codediff"]
cmd = code --wait --diff $LOCAL $REMOTE
[mergetool "codediff"]
cmd = code --wait --merge $REMOTE $LOCAL $BASE $MERGED
[color]
diff = always
interactive = always
status = always
branch = always
[alias]
st = status
ci = commit
co = checkout
br = branch
pf = push --force-with-lease
pushtag = push origin --tags
fixup = commit --all --amend --no-edit
open = "!openInBrowser() { \
if [ -z \"$1\" ]; then \
echo \"URL is empty.\"; \
return; \
fi; \
echo "Opening $1" ...; \
THIS_OS="$(uname -s)"; \
case "$THIS_OS" in \
Linux*) xdg-open $1;; \
MSYS_NT*|MINGW*|CYGWIN*) explorer $1;; \
*) echo \"unknown: $THIS_OS\";; \
esac; \
}; \
browse() { \
REMOTE=origin; \
if ! [ -z \"$1\" ]; then \
REMOTE=$1; \
fi; \
ORIGIN=`git config remote.$REMOTE.url`; \
case $ORIGIN in \
'') return;; \
https://*) openInBrowser $ORIGIN;; \
*) \
HTTPS_URL=$(echo \"$ORIGIN\" | awk -F '@' '{print $2}' | awk -F ' ' '{print $1}' | sed 's/:/\\//g' | sed 's/.git//g' | awk '{print \"https://\"$1}' ); \
openInBrowser "$HTTPS_URL";; \
esac; \
}; browse"
browse = !git open
up = push upstream master
sync = pull upstream master --rebase
which = !git branch | grep -i
daily = !sh -c 'git log --since=yesterday --format=%s --author=\"`git config user.email`\"'
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
graph = log --graph
ngrok = "!f() { \
NGROK_WAIT=${NGROK_WAIT:-1}; \
git serve & ngrok tcp 9418 > /dev/null 2>&1 & \
echo >&2 "Waiting $NGROK_WAIT seconds for git daemon and ngrok to start..."; \
sleep $NGROK_WAIT; \
public_url=$(curl -s http://localhost:4040/api/tunnels/command_line | jq -r '.public_url[3:]'); \
public_url="git$public_url/"; \
echo "Serving repo at: $public_url"; \
echo "Press CTRL C to stop."; \
sleep infinity; \
}; f"
squash = "!f() { git reset --hard $1; git merge --squash HEAD@{1}; git commit; }; f"
continue = "-c core.editor=true rebase --continue"
[pull]
ff = only
[push]
default = simple
autoSetupRemote = true
[log]
decorate = full
abbrevCommit = true
[format]
pretty=format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset
[gui]
gcwarning = false
[commit]
gpgsign = true
[diff "pandoc2md"]
textconv = pandoc --to=markdown
[diff "wrap"]
textconv = fmt
[diff "xlsx"]
textconv = python -m xlsx2csv
[diff "listzipfiles"]
textconv = unzip -l
[merge "npm-merge-driver"]
name = automatically merge npm lockfiles
driver = npx npm-merge-driver merge %A %O %B %P
[init]
defaultBranch = main
[rerere]
enabled = true
[core]
pager = delta --dark
longpaths = true
;sshCommand = C:/WINDOWS/System32/OpenSSH/ssh.exe
; install with: winget install Microsoft.OpenSSH.Beta
sshCommand = \"C:\\Program Files\\OpenSSH\\ssh.exe\"
attributesfile = ~/.gitattributes
[credential]
[gpg]
program = C:/Program Files (x86)/GnuPG/bin/gpg.exe
; program = C:/Program Files/Git/usr/bin/gpg.exe
[gpg "ssh"]
defaultKeyCommand = ssh-add -L
[difftool]
prompt = true
[difftool "vsdiffmerge"]
cmd = \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t
keepBackup = false
[mergetool]
prompt = true
[mergetool "vsdiffmerge"]
cmd = \"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m
keepBackup = false
trustExitCode = true
[pack]
windowMemory = 0