Auto-mirror your working tree to a throwaway branch on GitHub. One rolling commit, force-pushed every half second. Never lose work from an AI agent again.
curl -fsSL https://raw.githubusercontent.com/The-Cloud-Clockwork/gitfoam/main/install.sh | shDrops a static binary at ~/.local/bin/gitfoam. Make sure that's on your PATH.
cd /path/to/your/repo
gitfoam init # registers this repo with sensible defaults
gitfoam daemon # start mirroringgitfoam init auto-derives the target branch as gitfoam/<hostname>/<current-branch>. Run it inside as many repos as you want — each one gets added to ~/.gitfoam.json. Tune anything afterwards by editing the file directly.
Edit files, watch them appear on the mirror branch in GitHub within ~500ms. Merge into your real branch whenever you want via PR.
- Watches the repo every 500ms.
- When dirty → builds an orphan commit of the current tree → force-pushes to your target branch.
- Target branch always has exactly one commit. No history, no conflicts, no merges.
- Your working branch, your index, and your
git statusare never touched. - Secrets (AWS keys, GitHub PATs, JWTs, private keys, high-entropy strings) are excluded from the commit and logged to
~/.gitfoam/blocked.log.
gitfoam init [path] # register a repo with sensible defaults
gitfoam add <path> --target <branch> # register a repo (explicit)
gitfoam list # show configured repos
gitfoam status # show dirty/clean + paused state
gitfoam pause <path> # stop mirroring
gitfoam resume <path> # resume mirroring
gitfoam remove <path> # unregister
gitfoam daemon # run in foregroundConfig lives at ~/.gitfoam.json. Edit it directly if you prefer — takes effect on daemon restart.
mkdir -p ~/.config/systemd/user
curl -fsSL https://raw.githubusercontent.com/The-Cloud-Clockwork/gitfoam/main/systemd/gitfoam.service \
> ~/.config/systemd/user/gitfoam.service
systemctl --user enable --now gitfoam
journalctl --user -u gitfoam -fOr just nohup gitfoam daemon & — your call.
- Auth. gitfoam shells out to
git push. Your SSH agent / credential helper / PAT must already work. - Merging, pulling, rebasing. The target branch is disposable. Review on GitHub, merge manually, delete whenever.
rm ~/.local/bin/gitfoam ~/.gitfoam.json
rm -rf ~/.gitfoamMIT. Source: github.com/The-Cloud-Clockwork/gitfoam