-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
73 lines (64 loc) · 2.14 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
73 lines (64 loc) · 2.14 KB
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
{{/*
Three layers of per-machine divergence:
1. Default identity — driven by data in ~/.config/chezmoi/chezmoi.toml
(lives outside the repo, per-machine). Change name/email there.
2. Hostname-aware branching — `{{ if eq .chezmoi.hostname "..." }}`.
Extend the block below with whatever per-host overrides you need
(signing keys, custom ssh commands, alternate pagers).
3. Directory-aware include — `[includeIf "gitdir:~/work/"]` below.
Drop a ~/.gitconfig-work (untracked) on any machine that has
work repos. git auto-includes it for any repo under ~/work/.
Template at scripts/.gitconfig-work.example.
*/ -}}
[user]
email = {{ .git.email }}
name = {{ .git.name }}
{{- if hasKey .git "signingkey" }}
signingkey = {{ .git.signingkey }}
[commit]
gpgsign = true
{{- end }}
[credential "https://github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
[credential "https://gist.github.com"]
helper =
helper = !{{ lookPath "gh" }} auth git-credential
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true
light = false
line-numbers = true
side-by-side = true
syntax-theme = base16
[merge]
conflictstyle = zdiff3
[diff]
colorMoved = default
[init]
defaultBranch = main
{{/* Hostname-specific tweaks. Add branches here as new machines come online.
Example:
{{ if eq .chezmoi.hostname "work-laptop" }}
[core]
sshCommand = "ssh -i ~/.ssh/work_id_ed25519"
{{ end }}
*/ -}}
# Per-directory override — git auto-loads ~/.gitconfig-work for repos under ~/work/.
# Create that file (NOT tracked) from scripts/.gitconfig-work.example when needed.
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-work
{{/* Alt-identity workspace override. Paths live in per-machine chezmoi data,
keeping the committed template independent of any org or local layout.
altConfig defaults to the legacy ~/.gitconfig-alt when omitted. */ -}}
{{- if hasKey .git "altWorkspace" }}
[includeIf "gitdir:{{ .git.altWorkspace }}"]
{{- if hasKey .git "altConfig" }}
path = {{ .git.altConfig }}
{{- else }}
path = ~/.gitconfig-alt
{{- end }}
{{- end }}