checkin all script

This commit is contained in:
2026-05-10 12:57:59 -07:00
parent 83156ea9e8
commit f40f0259bd

28
checkin-all Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
set -euo pipefail
GIT_HOME="${HOME}/git"
for dir in "${GIT_HOME}"/*/; do
if [ -d "${dir}/.git" ]; then
repo=$(basename "${dir}")
remote=$(git -C "${dir}" remote get-url origin 2>/dev/null || true)
case "${remote}" in
*schmeeve*)
;;
*)
echo " Skipping (not your repo: ${remote})"
continue
;;
esac
echo "=== ${repo} ==="
cd "${dir}"
if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
echo " Changes found → committing and pushing..."
git commit -a -m "auto: $(date '+%Y-%m-%d %H:%M')" || echo " Nothing to commit (maybe no tracked files changed)"
git push
else
echo " Clean."
fi
fi
done