-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_gitconfig.tmpl
116 lines (116 loc) · 3.5 KB
/
dot_gitconfig.tmpl
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
{{- $gitPath := "git" }}
{{- /* Binaries installed by Homebrew on Apple Silicon are under /opt/homebrew/bin and might not be on the path */ -}}
{{- if and (eq .chezmoi.os "darwin" ) (eq .chezmoi.arch "arm64") (not (lookPath $gitPath)) -}}
{{- $gitPath = "/opt/homebrew/bin/git" -}}
{{- end -}}
{{- $gitVersion := semver "0" -}}
{{- if lookPath $gitPath -}}
{{- $gitVersion = output $gitPath "--version" | trimSuffix "\n" | splitList " " | last | semver -}}
{{- end -}}
[init]
defaultBranch = master
templateDir = "~/.config/git/template"
[user]
name = "Alexis Jeandeau"
email = {{ .email | quote }}
{{- if not .work }}
signingkey = 7BD79C2E53F866DB
{{- else }}
signingkey = 0B0DB8BEF26C467F
{{- end }}
[commit]
gpgsign = true
{{- if lookPath "git-credential-keepassxc" }}
[credential]
# https://github.com/frederick888/git-credential-keepassxc
helper = keepassxc
{{- end }}
[merge]
{{- if ge (semver "2.35" | $gitVersion.Compare) 0 }}
conflictStyle = zdiff3
{{- end }}
tool = vimd
[diff]
guitool = gvimdiff
[pull]
ff = only
[core]
autocrlf = false
editor = vim -f
filemode = false
fsmonitor = true
# Force symlinks (not set by default on Windows)
symlinks = true
{{- if ge (semver "2.31" | $gitVersion.Compare) 0 }}
[maintenance]
auto = false
strategy = incremental
{{- end }}
{{- if ge (semver "2.42" | $gitVersion.Compare) 0 }}
[pack]
useBitmapBoundaryTraversal = true
{{- end }}
[rerere]
enabled = true
[alias]
co = checkout
st = status -sb
cl = clone
ci = commit
br = branch
s = stash
sd = stash drop
sp = stash pop
spull = !sh -c 'git stash && git pull && git stash pop'
df = diff
dt = difftool
logg = log --color --graph --format=fuller --show-signature
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
headsha = log --format="%H" -n 1
who = shortlog -s -n --no-merges
pushf = push --force-with-lease
sdcommit = !sh -c 'git stash && git svn dcommit && git stash pop'
srebase = !sh -c 'git stash && git svn rebase && git stash pop'
k = !sh -c 'nohup gitk --all &'
guik = !sh -c '(nohup gitk --all &) && (nohup git gui &)'
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
serve2 = !sh -c 'git daemon --reuseaddr --verbose \"$@\" --base-path=. --export-all ./.git' sh
plfs = !git -c filter.lfs.smudge= -c filter.lfs.required=false pull && git lfs pull
brshow = config --get-regexp 'branch.*.description'
brdesc = !git config --get "branch.$(git branch --show-current).description"
{{- if ne .chezmoi.os "darwin" }}
# Find duplicate files from root
alldupes = !"git ls-tree -r HEAD | cut -c 13- | sort | uniq -D -w 40"
# Find duplicate files from the current folder (can also be root)
dupes = !"cd `pwd`/$GIT_PREFIX && git ls-tree -r HEAD | cut -c 13- | sort | uniq -D -w 40"
{{- end }}
[rebase]
autoSquash = true
[color]
ui = true
branch = auto
diff = auto
interactive = auto
status = auto
[tar "tar.bz2"]
command = bzip2
[tar "tar.xz"]
command = xz -c
{{- if .work }}
# Use HTTPS instead of the Git protocol for GitHub
[url "https://github.com"]
insteadOf = git://github.com
{{- end }}
# Use the SSH instead of HTTPS for Bitbucket (required for 2FA)
[url "git@bitbucket.org:"]
insteadOf = https://bitbucket.org/
# Clone and push to AUR using the "aur:" prefix
[url "https://aur.archlinux.org/"]
insteadOf = "aur:"
[url "ssh://aur@aur.archlinux.org/"]
pushInsteadOf = "aur:"
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true