Repository navigation
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
164 lines (162 loc) · 5.38 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
164 lines (162 loc) · 5.38 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
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
{{- $dotfilesGitDir := "~/projects/dotfiles/" -}}
{{- $personalGithubUser := .git.personal.name -}}
{{- if hasKey .git.personal "githubUser" -}}
{{- $personalGithubUser = .git.personal.githubUser -}}
{{- end -}}
{{- $personalReposGitDir := printf "~/dev/repos/github.com/%s/" $personalGithubUser -}}
{{- $personalCodebergUser := $personalGithubUser -}}
{{- if hasKey . "codeberg" -}}
{{- if hasKey .codeberg "user" -}}
{{- $personalCodebergUser = .codeberg.user -}}
{{- end -}}
{{- end -}}
{{- $codebergHost := "codeberg.org" -}}
{{- if hasKey . "codeberg" -}}
{{- if hasKey .codeberg "host" -}}
{{- $codebergHost = .codeberg.host -}}
{{- end -}}
{{- end -}}
{{- $personalForgeHost := $codebergHost -}}
{{- $personalForgeReposGitDir := printf "~/dev/repos/%s/%s/" $personalForgeHost $personalCodebergUser -}}
{{- $chezmoiSourceDir := trimSuffix "/" .chezmoi.sourceDir -}}
{{- $chezmoiSourceGitDir := printf "%s/" $chezmoiSourceDir -}}
{{- $windowsLocalAppData := replace "\\" "/" (env "LOCALAPPDATA") -}}
{{- $kdiff3Cmd := `kdiff3 "$LOCAL" "$REMOTE"` -}}
{{- if hasPrefix .chezmoi.homeDir .chezmoi.sourceDir -}}
{{- $chezmoiSourceGitDir = printf "%s/" (replace .chezmoi.homeDir "~" $chezmoiSourceDir) -}}
{{- end -}}
{{- if eq .chezmoi.os "darwin" -}}
{{- $kdiff3Cmd = `test -x "/Applications/kdiff3.app/Contents/MacOS/kdiff3" && "/Applications/kdiff3.app/Contents/MacOS/kdiff3" "$LOCAL" "$REMOTE" || kdiff3 "$LOCAL" "$REMOTE"` -}}
{{- end -}}
[alias]
st = status
ci = commit
br = branch
co = checkout
diffc = diff --cached
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%an]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=relative
switch = !legit switch "$@"
branches = !legit branches
sprout = !legit sprout "$@"
unpublish = !legit unpublish "$@"
harvest = !legit harvest "$@"
sync = !legit sync "$@"
publish = !legit publish "$@"
graft = !legit graft "$@"
[branch]
autosetupmerge = true
[color]
ui = true
[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
[core]
excludesfile = ~/.gitignore_global
editor = vim -f
whitespace = trailing-space,space-before-tab
quotepath = false
pager = delta
[interactive]
diffFilter = delta --color-only
[difftool "kdiff3"]
cmd = {{ $kdiff3Cmd }}
[init]
templatedir = ~/.git_template
[merge]
# Delta is a pager, not a merge UI; open diffview.nvim during conflicts (needs Neovim + diffview).
tool = diffview
keepBackup = false
conflictStyle = zdiff3
[mergetool "diffview"]
cmd = nvim -n -c "DiffviewOpen --selected-file=\"$MERGED\""
[rerere]
enabled = true
[delta]
line-numbers = true
navigate = true
[gpg]
format = ssh
[gpg "ssh"]
allowedSignersFile = ~/.ssh/allowed_signers
{{- if eq .chezmoi.os "darwin" }}
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
{{- end }}
[commit]
gpgsign = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
{{- if eq .chezmoi.os "darwin" }}
[credential]
helper = osxkeychain
{{- else if and (eq .chezmoi.os "linux") (ne (env "WSL_DISTRO_NAME") "") }}
[core]
sshCommand = /mnt/c/Windows/System32/OpenSSH/ssh.exe
[gpg "ssh"]
{{- if hasPrefix "/mnt/" $windowsLocalAppData }}
program = "{{ $windowsLocalAppData }}/Microsoft/WindowsApps/op-ssh-sign-wsl.exe"
{{- else }}
program = op-ssh-sign-wsl.exe
{{- end }}
[credential]
helper = cache --timeout=7200
{{- else if eq .chezmoi.os "windows" }}
[core]
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
[gpg "ssh"]
{{- if ne $windowsLocalAppData "" }}
program = "{{ $windowsLocalAppData }}/Microsoft/WindowsApps/op-ssh-sign.exe"
{{- else }}
program = op-ssh-sign.exe
{{- end }}
[credential]
helper = manager
{{- else }}
[credential]
helper = cache --timeout=7200
{{- end }}
[include]
path = ~/.gitconfig-{{ .profile }}
[includeIf "gitdir:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir:{{ $personalReposGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $personalReposGitDir }}"]
path = ~/.gitconfig-personal
{{- if ne $personalForgeHost "github.com" }}
[includeIf "gitdir:{{ $personalForgeReposGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $personalForgeReposGitDir }}"]
path = ~/.gitconfig-personal
{{- end }}
[includeIf "gitdir:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-chezmoi
[includeIf "gitdir/i:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-chezmoi
[includeIf "gitdir:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-chezmoi
[includeIf "gitdir/i:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-chezmoi