-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_gitconfig.tmpl
More file actions
110 lines (90 loc) · 3.59 KB
/
Copy pathdot_gitconfig.tmpl
File metadata and controls
110 lines (90 loc) · 3.59 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
{{- $workOrg := .work.org_slug -}}
[user]
name = Marvin Dore
email = hi@marvindore.com
[core]
pager = delta
longpaths = true
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
dark = true # or light = true, or omit for auto-detection
hyperlinks = true
conflict-style = diff3
conflict-marker-begin = "▶ ▶ ▶ ▶ ▶"
conflict-marker-end = "◀ ◀ ◀ ◀ ◀"
# This makes the actual conflict area background dark red/blue
minus-emph-style = "bold red 52"
plus-emph-style = "bold green 22"
[merge]
# Primary conflict resolution is diffview.nvim (`git dm` / shell `gmerge`).
# It parses conflict markers directly, so one choose resolves a full
# conflict — reliable per-conflict and whole-file choose.
# kdiff3 is the GUI fallback for complex 3-way cases (`git mergetoolx`),
# and is the git-native default below so a bare `git mergetool` is sane.
# The raw nvimdiff path is retired: its :diffget worked on diff hunks, not
# conflict regions, so a single choose left half the conflict behind.
tool = kdiff3
conflictStyle = zdiff3
[mergetool]
prompt = false
keepBackup = false
[mergetool "kdiff3"]
cmd = kdiff3 "$LOCAL" "$BASE" "$REMOTE" -o "$MERGED"
trustExitCode = true
[alias]
# Difftastic aliases
dl = -c diff.external=difft log --ext-diff
ds = -c diff.external=difft show --ext-diff
dd = -c diff.external=difft diff
dlp = -c diff.external=difft log -p --ext-diff
# Primary merge workflow: diffview.nvim resolves conflicts from the working
# tree. `dm` opens diffview, then stages everything on exit.
# kdiff3 is the GUI fallback via the built-in `git mergetool` (merge.tool).
nvim-merge = "!nvim -c DiffviewOpen"
dm = "!nvim -c DiffviewOpen && git add . && echo \"Conflicts resolved. Ready to commit.\""
[difftool]
difftool = true
prompt = false
[pager]
difftool = true
[diff]
# Set difftastic as the default difftool, so we don't need to specify
# `-t difftastic` every time.
tool = difftastic
[difftool "difftastic"]
prompt = false
cmd = difft "$LOCAL" "$REMOTE"
[url "git@work:{{ $workOrg }}/"]
insteadOf = git@github.com:{{ $workOrg }}/
[url "git@home:"]
insteadOf = git@github.com:
{{ if eq .chezmoi.os "windows" -}}
[gpg]
program = C:\\Program Files (x86)\\gnupg\\bin\\gpg.exe
[safe]
directory = C:/Projects
# Force lfs to use https because ssh not working: failing command (GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs pull)
# set for your local profile: git config --local lfs.url (company-https-url)/info/lfs
#[lfs]
# url = (company-https-url)/info/lfs
# User different gitconfig based on directory
{{ end -}}
# Deterministic SSH key selection via host aliases.
# Longest-prefix match wins, so the work rule beats the personal catch-all.
# `git@work:` and `git@home:` are defined in ~/.ssh/config with IdentitiesOnly yes.
[url "git@work:{{$workOrg}}/"]
insteadOf = git@github.com:{{$workOrg}}/
insteadOf = https://github.com/{{$workOrg}}/
# Only ssh form is rewritten here. Rewriting https://github.com/ would also
# capture public https submodules in third-party repos and force them through
# the personal key, breaking unauthenticated read access.
[url "git@home:"]
insteadOf = git@github.com:
[includeIf "hasconfig:remote.*.url:git@github.com:{{$workOrg}}/**"]
path = .gitconfig-work
[includeIf "hasconfig:remote.*.url:https://github.com/{{$workOrg}}/**"]
path = .gitconfig-work
[includeIf "hasconfig:remote.*.url:git@work:{{$workOrg}}/**"]
path = .gitconfig-work