-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodify_dot_gitconfig
More file actions
executable file
·83 lines (79 loc) · 1.84 KB
/
Copy pathmodify_dot_gitconfig
File metadata and controls
executable file
·83 lines (79 loc) · 1.84 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
#!/bin/bash
# chezmoi modify script for .gitconfig
# Preserves unmanaged sections (like [credential] injected by DevPod)
# Read current file from stdin
current=$(cat)
# Extract unmanaged sections (e.g., [credential] injected by DevPod)
preserved=$(echo "$current" | awk '
/^\[credential\]/ { found=1 }
/^\[/ && !/^\[credential\]/ { found=0 }
found { print }
')
# Write our managed template
cat << 'MANAGED'
[core]
pager = delta
editor = nvim
excludesFile = ~/.gitignore.everywhere
[gpg]
format = ssh
[gpg "ssh"]
program = ssh-keygen
allowedSignersFile = /home/owner/.ssh/allowed_signers
[user]
signingkey = ~/.ssh/git-signing.pub
[commit]
# Note: before disabling, consider `--no-gpg-sign` where needed
# example: git rebase --interactive --no-gpg-sign && git commit --amend
gpgsign = true
[pull]
ff = only
[push]
default = simple
autoSetupRemote = true
[url "git@github.com:"]
pushInsteadOf = git://github.com/
pushInsteadOf = https://github.com/
[alias]
cl = clone
co = checkout
br = branch
ci = commit
st = status
lg = log --oneline --decorate --graph --all
r = remote
re = remote
sw = switch
[color]
ui = true
[interactive]
diffFilter = delta --color-only
[add.interactive]
useBuiltin = false # required for git 2.37.0
[delta]
features = side-by-side line-numbers decorations
syntax-theme = tokyonight_moon
side-by-side = true
hunk-header-style = syntax
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
[merge]
tool = nvimdiff
conflictstyle = zdiff3
[mergetool "nvimdiff"]
layout = "LOCAL,BASE,REMOTE / MERGED"
[mergetool]
prompt = true
[diff]
colorMoved = default
[init]
defaultBranch = main
[pager]
branch = false
MANAGED
# Append preserved sections if any
if [ -n "$preserved" ]; then
echo "$preserved"
fi