~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.config/git/git-identities.gitconfig -rw-r--r-- 4.9 KiB
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
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
165
166
167
168
169
170
# git identity + forge configs
# Add to ~/.gitconfig:
#   [include]
#       path = ~/dev/100x/dev/configs/git-identities.gitconfig
#
# Per-directory identity switching:
#   [includeIf "gitdir:~/dev/"]
#       path = ~/dev/100x/dev/configs/git-identities.gitconfig
#   [includeIf "gitdir:~/work/"]
#       path = ~/dev/100x/dev/configs/git-identity-work.gitconfig

# ============================================================
# DEFAULT IDENTITY (personal)
# ============================================================

[user]
    name = Kris Yotam
    email = kris@krisyotam.com
    signingkey = ~/.ssh/id_ed25519

[commit]
    gpgsign = true

[gpg]
    format = ssh

[gpg "ssh"]
    allowedSignersFile = ~/.config/git/allowed_signers

# ============================================================
# FORGE: sourcehut (default)
# ============================================================

[url "git@git.sr.ht:~krisyotam/"]
    insteadOf = srht:

[url "https://git.sr.ht/~krisyotam/"]
    insteadOf = srht-https:

# git clone srht:repo-name
# git clone srht-https:repo-name (read-only)

# ============================================================
# FORGE: codeberg
# ============================================================

[url "git@codeberg.org:krisyotam/"]
    insteadOf = cb:

[url "https://codeberg.org/krisyotam/"]
    insteadOf = cb-https:

# git clone cb:repo-name
# git clone cb-https:repo-name (read-only)

# ============================================================
# FORGE: gitlab
# ============================================================

[url "git@gitlab.com:krisyotam/"]
    insteadOf = gl:

[url "https://gitlab.com/krisyotam/"]
    insteadOf = gl-https:

# git clone gl:repo-name

# ============================================================
# FORGE: github
# ============================================================

[url "git@github.com:krisyotam/"]
    insteadOf = gh:

[url "https://github.com/krisyotam/"]
    insteadOf = gh-https:

# git clone gh:repo-name

# ============================================================
# FORGE: cgit (self-hosted, STARGATE)
# ============================================================
# cgit is a web frontend for git repos served over HTTP/SSH.
# Repos live at /srv/git/ on STARGATE, served by cgit + nginx.
#
# Setup needed:
#   1. mkdir -p /srv/git on STARGATE
#   2. Install cgit, configure /etc/cgitrc
#   3. nginx: proxy /cgit to cgit CGI or use fcgiwrap
#   4. SSH: add git user or use krisyotam user for push
#   5. Public URL: git.krisyotam.com or krisyotam.com/cgit

[url "krisyotam@100.74.152.79:/srv/git/"]
    insteadOf = cgit:

[url "https://git.krisyotam.com/"]
    insteadOf = cgit-https:

# git clone cgit:repo-name       (SSH, read-write via Tailscale)
# git clone cgit-https:repo-name (HTTPS, read-only public)

# ============================================================
# FORGE: git9 (Plan 9)
# ============================================================
# git9 is the native Plan 9 git client. Repos are accessed
# via 9p or HTTP. This config is for pushing FROM Linux to a
# Plan 9 git server (e.g. on a 9front machine or vm).
#
# Setup needed:
#   1. git9 installed on Plan 9 side
#   2. Export repos via ip/httpd or 9p
#   3. On Linux, access via HTTP or 9pfuse mount
#
# 9p mount approach (Linux):
#   9pfuse 'tcp!plan9host!564' /mnt/9p
#   git clone /mnt/9p/git/repo-name
#
# HTTP approach:

[url "http://plan9.krisyotam.com/git/"]
    insteadOf = g9:

[url "http://100.74.152.79:8000/git/"]
    insteadOf = g9-local:

# git clone g9:repo-name         (HTTP, public)
# git clone g9-local:repo-name   (HTTP, Tailscale)

# ============================================================
# MULTI-REMOTE HELPERS
# ============================================================
# Push to all forges at once. Add to a repo:
#
#   git remote add all gh:repo-name
#   git remote set-url --add --push all srht:repo-name
#   git remote set-url --add --push all cb:repo-name
#   git remote set-url --add --push all cgit:repo-name
#
# Then: git push all main

# ============================================================
# FORGE ALIASES
# ============================================================

[alias]
    # Clone shortcuts
    # git srht-clone repo-name
    srht-clone = "!f() { git clone srht:$1; }; f"
    cb-clone = "!f() { git clone cb:$1; }; f"
    gl-clone = "!f() { git clone gl:$1; }; f"
    gh-clone = "!f() { git clone gh:$1; }; f"

    # Show all remotes with URLs
    remotes = remote -v

    # Add a forge as remote
    # git add-forge srht repo-name
    add-forge = "!f() { \
        case $1 in \
            srht) git remote add srht srht:$2 ;; \
            cb)   git remote add codeberg cb:$2 ;; \
            gl)   git remote add gitlab gl:$2 ;; \
            gh)   git remote add github gh:$2 ;; \
            cgit) git remote add cgit cgit:$2 ;; \
            *)    echo \"unknown forge: $1\" ;; \
        esac; \
    }; f"

    # Push to all configured remotes
    push-all = "!git remote | xargs -I{} git push {} HEAD"