# 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"