-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
127 lines (124 loc) · 4.33 KB
/
dot_gitconfig.tmpl
File metadata and controls
127 lines (124 loc) · 4.33 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
{{- $dotfilesGitDir := "~/projects/dotfiles/" -}}
{{- $aguilReposGitDir := "~/dev/repos/github.com/aguil/" -}}
{{- $chezmoiSourceDir := trimSuffix "/" .chezmoi.sourceDir -}}
{{- $chezmoiSourceGitDir := printf "%s/" $chezmoiSourceDir -}}
{{- $kdiff3Cmd := `kdiff3 "$LOCAL" "$REMOTE"` -}}
{{- $p4mergeCmd := `p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"` -}}
{{- 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"` -}}
{{- $p4mergeCmd = `test -x "/Applications/p4merge.app/Contents/Resources/launchp4merge" && "/Applications/p4merge.app/Contents/Resources/launchp4merge" "$BASE" "$LOCAL" "$REMOTE" "$MERGED" || ( test -x "/Applications/p4merge.app/Contents/MacOS/p4merge" && "/Applications/p4merge.app/Contents/MacOS/p4merge" "$BASE" "$LOCAL" "$REMOTE" "$MERGED" || p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" )` -}}
{{- 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
[difftool "kdiff3"]
cmd = {{ $kdiff3Cmd }}
[init]
templatedir = ~/.git_template
[merge]
tool = p4merge
keepBackup = false
[mergetool "p4merge"]
cmd = {{ $p4mergeCmd }}
keepTemporaries = false
trustExitCode = false
keepBackup = false
[rerere]
enabled = 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"]
program = /mnt/c/Windows/System32/OpenSSH/ssh-keygen.exe
[credential]
helper = cache --timeout=7200
{{- else if eq .chezmoi.os "windows" }}
[core]
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
[gpg "ssh"]
program = "C:/Program Files/1Password/app/8/op-ssh-sign.exe"
[credential]
helper = manager
{{- else }}
[credential]
helper = cache --timeout=7200
{{- end }}
[url "git@github-aguil:aguil/"]
insteadOf = git@github.com:aguil/
[url "git@github-aguil:aguil/"]
insteadOf = https://github.com/aguil/
[url "git@github-aguil:aguil/"]
insteadOf = ssh://git@github.com/aguil/
[include]
path = ~/.gitconfig-{{ .profile }}
[includeIf "gitdir:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $dotfilesGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir:{{ $aguilReposGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $aguilReposGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-personal
[includeIf "gitdir/i:{{ $chezmoiSourceGitDir }}"]
path = ~/.gitconfig-personal