summaryrefslogtreecommitdiffstatshomepage
path: root/dot_config/git/config.tmpl
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-17 15:05:36 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-17 15:05:36 +0100
commitaff435a0fb3a56b1d7b738c7dede363440884b3a (patch)
tree07acb41d37760aa169ee42dbeb69da3621cc7489 /dot_config/git/config.tmpl
parenta7f74c1fa4b89c5829f5896842eb7248c820704c (diff)
downloaddotfiles-aff435a0fb3a56b1d7b738c7dede363440884b3a.tar.gz
dotfiles-aff435a0fb3a56b1d7b738c7dede363440884b3a.tar.bz2
dotfiles-aff435a0fb3a56b1d7b738c7dede363440884b3a.zip
Add the Canonical laptop profile and setup workflows
Diffstat (limited to 'dot_config/git/config.tmpl')
-rw-r--r--dot_config/git/config.tmpl164
1 files changed, 164 insertions, 0 deletions
diff --git a/dot_config/git/config.tmpl b/dot_config/git/config.tmpl
new file mode 100644
index 0000000..9987261
--- /dev/null
+++ b/dot_config/git/config.tmpl
@@ -0,0 +1,164 @@
+[user]
+{{ if eq (default "host" (index . "machineRole")) "canonical" }}
+ email = {{ .workEmail | quote }}
+ name = {{ .workName | quote }}
+ signingkey = {{ .workSigningKey | quote }}
+{{ else }}
+ email = sommerfeld@sommerfeld.dev
+ name = sommerfeld
+ signingkey = 3298945F717C85F8
+{{ end }}
+[push]
+ autoSetupRemote = true
+ followTags = true
+ gpgSign = if-asked
+[core]
+ whitespace = trailing-space,cr-at-eol
+ pager = delta
+{{ if ne (default "host" (index . "machineRole")) "canonical" }}
+ hooksPath = ~/.config/git/hooks
+ sshCommand = "ssh -i ~/.ssh/nym.pub"
+{{ end }}
+[branch]
+ sort=-committerdate
+[diff]
+ tool = nvimdiff
+ algorithm = histogram
+ colorMoved = default
+ colorMovedWS = allow-indentation-change
+ mnemonicPrefix = true
+ relative = true
+ renameLimit = 10000
+[difftool]
+ prompt = false
+ trustExitCode = true
+[pager]
+ difftool = true
+[difftool "nvimdiff"]
+ cmd = $EDITOR -d $LOCAL $REMOTE
+[difftool "difftastic"]
+ cmd = difft "$MERGED" "$LOCAL" "abcdef1" "100644" "$REMOTE" "abcdef2" "100644"
+[rebase]
+ autoStash = true
+ autoSquash = true
+ updateRefs = true
+[fetch]
+ recurseSubmodules = on-demand
+ prune = true
+[rerere]
+ enabled = true
+[pull]
+ ff = only
+[merge]
+ tool = conflictmarker
+ conflictstyle = zdiff3
+[merge "mergiraf"]
+ name = mergiraf
+ driver = mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P
+[mergetool]
+ keepBackup = false
+[mergetool "conflictmarker"]
+ cmd = $EDITOR "$MERGED"
+[commit]
+ gpgsign = true
+[tag]
+ gpgSign = true
+[status]
+ short = true
+ branch = true
+ showUntrackedFiles = all
+ showStash = true
+ submoduleSummary = true
+[help]
+ autocorrect = prompt
+[log]
+ abbrevCommit = true
+ date = short
+[interactive]
+ singleKey = true
+ diffFilter = delta --color-only
+[advice]
+ detachedHead = false
+ skippedCherryPicks = false
+[column]
+ ui = auto
+[format]
+ pretty = oneline
+[delta]
+ navigate = true
+ features = gruvmax-fang zebra-dark
+ dark = true
+ side-by-side = true
+ line-numbers = true
+ relative-paths = true
+ hyperlinks = false
+[absorb]
+ autoStageIfNothingStaged = true
+[alias]
+ resign = "!git show -s --format=%B HEAD | sed \"/^Co-authored-by:/Id\" | git -c core.hooksPath=/dev/null commit --amend --reset-author --no-verify --cleanup=strip -S -F -"
+ ghost-rebase = "!sh -c 'b=$0; u=${1:-origin/main}; wt=$(mktemp -d -t rebwt.XXXXXX); git worktree add -f "$wt" "$b"; git -C "$wt" rebase "$u" || echo "Rebase incomplete"; git worktree remove --force "$wt"'"
+ a = add
+ ab=absorb --and-rebase
+ b = branch -vv
+ bd = branch -D
+ c = commit
+ ca = commit --amend --no-edit
+ cp = cherry-pick
+ d = diff
+ dft = -c diff.external=difft diff
+ dl = -c diff.external=difft log -p --ext-diff
+ ds = -c diff.external=difft show --ext-diff
+ dt = difftool
+ f = fetch
+ fa = fetch --all
+ ff = merge --ff-only
+ find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
+ fmt = clang-format -f
+ fp = push --force-with-lease
+ gone = !git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D
+ l = log
+ lg = log --graph --oneline
+ lm = log --pretty=medium
+ m = merge
+ mt = mergetool
+ p = push
+ r = rebase
+ rnh = "!f() { git -c core.hooksPath=/dev/null rebase \"$@\"; }; f"
+ re = remote -v
+ ri = rebase -i
+ rt = restore
+ s = status
+ st = status --no-short
+ staged = diff --cached
+ sub = submodule
+ subf = submodule foreach
+ sw = switch
+ swc = switch -c
+ swd = switch -d
+ unstage = reset HEAD --
+ update=!git fetch && git merge --ff-only
+{{ if ne (default "host" (index . "machineRole")) "canonical" }}
+[includeIf "gitdir:~/doxfiles/.git"]
+ path = config-personal
+[includeIf "gitdir:~/dev/personal/"]
+ path = config-personal
+[includeIf "gitdir:~/dev/canonical/"]
+ path = config-work
+[sendemail]
+ smtpServer = 127.0.0.1
+ smtpServerPort = 1016
+ smtpEncryption = tls
+ smtpDomain = localhost
+ smtpSslCertPath =
+ confirm = auto
+ suppresscc = self
+ chainReplyTo = false
+ thread = true
+ annotate = true
+ assume8bitEncoding = UTF-8
+[credential "smtp://127.0.0.1:1016"]
+ helper = "!f() { test \"$1\" = get && printf 'password=%s\\n' \"$(pass show proton/bridge-smtp)\"; }; f"
+{{ end }}
+[include]
+ ; Machine-local overrides. Git silently skips this if the file is absent.
+ path = ~/.config/git/config.local