owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

commit c10c43572e2fdc58fa2b77b29e3ef4aa7001b69b
parent 95f5f641a5d2df0613e8bf4e8418308907883984
author Owen Rusk <owen@papermothgames.com>
date   2026-10-08 20:06:53 -0500
bin: pushall
bin/pushall+18-0
diff --git a/bin/pushall b/bin/pushall
new file mode 100755
index 0000000..3d56fb3
--- /dev/null
+++ b/bin/pushall
@@ -0,0 +1,18 @@
+#!/bin/sh
+# push every repository under ~/src to the code host, making any that aren't there yet.
+# it serves them over plain http, so each one needs update-server-info after.
+set -eu
+
+src=${SRC:-$HOME/src}
+host=${PUSHALL_HOST:-code}
+root=${PUSHALL_ROOT:-/srv/git}
+
+for dir in "$src"/*/; do
+    [ -d "$dir.git" ] || continue
+    name=$(basename "$dir")
+    repo=$root/$name.git
+    printf '== %s\n' "$name"
+    ssh "$host" "test -d '$repo' || git init -q --bare -b main '$repo'"
+    git -C "$dir" push -q "$host:$repo" --all
+    ssh "$host" "git -C '$repo' update-server-info"
+done