HeadlinesBriefing favicon HeadlinesBriefing.com

Home‑Server Git Remote Setup for Faster Pushes

Hacker News •
×

Alexander Cobleigh detailed a method for turning a home‑server folder into a Git remote that avoids the usual conflict pitfalls. He points to a project directory `/home/user/projects/cani` containing a `.git` subfolder, then creates a bare repository with `git clone --bare`. The result lives at `/home/user/bares/cani.git` and can serve as a remote. It runs on any Unix‑like box with Git installed, so hobbyists can adopt it.

On the same machine he adds the remote via `git remote add local /home/user/bares/cani.git`. From another host he uses the SSH form `git remote add local ssh://USER@MACHINE:/home/user/bares/cani.git`. Setting the default branch with `git remote set-branches local main` lets `git push local` and `git pull local` operate without extra arguments, while any custom SSH config works as well and respects existing branch names.

Cobleigh finds the local remote especially useful when the primary offsite mirror suffers downtime from heavy traffic or corporate scrapers. By pushing to the home server first, developers get instant feedback and avoid waiting on the unreliable external host. The setup creates a fast, private cache while still replicating to a community‑run server for backup.