-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_gitconfig.tmpl
123 lines (113 loc) · 2.93 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
117
118
119
120
121
122
123
[user]
{{- if (index . "git") }}
email = "{{ .git.email }}"
{{- else }}
email = "{{ .chezmoi.username }}@{{ .chezmoi.fqdnHostname }}"
{{- end }}
{{- if (index . "name") }}
name = "{{ .name }}"
{{- else }}
name = "{{ .chezmoi.username }}"
{{- end }}
# ## Signing commits
#
# Run `chezmoi edit-config`. Find or add a `[data.git]` section and set a
# `signingkey` as described below.
#
# ### Signing commits with SSH
#
# `signingkey` is the absolute path of an SSH public key that is associated
# to your GitHub or GitLab account.
#
# ```
# [data.git]
# # ...
# signingkey = /Users/stilist/.ssh/id_ed25519
# sign_with_ssh = true
# ```
#
# ### Signing commits with GPG
#
# `signingkey` is the public key of a GPG keypair.
#
# Assuming you've already generated a GPG keypair, you can use this command
# to get the public key for one of your active keypairs. Note that it will
# choose this keypair arbitrarily.
#
# gpg \
# --list-secret-keys \
# --keyid-format LONG \
# | grep expires \
# | grep '\[SC\]' \
# | head -1 \
# | awk '{ print $2 }' \
# | cut -d '/' -f 2
#
# If you want to use a specific keypair, run
#
# gpg --list-secret-keys --keyid-format LONG
#
# This will print a list of the keys you have installed. Once you find the
# keypair you're interested in (probably based on the associated email
# address), look for a string like 'rsa4096/<hex string>' -- for example,
# `rsa4096/C731AB053A9CF1F3`. The public key is the hexadecimal string after
# the `/`.
#
# ```
# [data.git]
# # ...
# signingkey = "C731AB053A9CF1F3"
# ```
{{- if and (index . "git") .git.signingkey }}
signingkey = "{{ .git.signingkey }}"
{{- else }}
# signingkey = ""
{{- end }}
[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 = cyan
[commit]
{{- if and (index . "git") .git.signingkey }}
gpgSign = true
{{- else }}
# gpgSign = true
{{- end }}
[credential]
{{- if eq .chezmoi.os "darwin" }}
helper = osxkeychain
{{- end }}
[filter "lfs"]
clean = git-lfs clean -- %f
process = git-lfs filter-process
required = true
smudge = git-lfs smudge -- %f
[gpg]
{{- if eq .chezmoi.os "darwin" }}
program = /usr/local/MacGPG2/bin/gpg2
{{- end }}
{{- if and (index . "git") (index .git "sign_with_ssh") }}
format = ssh
{{- end }}
# @see https://gist.github.com/acfoltzer/4284d240f2787eb1826ec074e08234b5
[init]
templateDir = "{{ .chezmoi.homeDir }}/.config/git/template/"
[merge]
# @see https://git-scm.com/docs/git-config#git-config-mergeconflictStyle
conflictstyle = diff3
[rerere]
# @see https://git-scm.com/2010/03/08/rerere.html
enabled = true
[status]
showUntrackedFiles = all