Serving your git repository on local network

Sometimes, I want to access a git repository without pushing it to a central remote. Turns out it's very easy to serve and/or access ssh repositories, easier than creating patches that don't retain author information and commit messages.

When I have ssh access to a machine where the repository lies in a folder, I can just pull it like this:

git pull ssh://server/path-to-repository

If you can't ssh, but the two machines can talk over the network, you can use a git daemon.

# On the source side
git daemon --reuseaddr --verbose --export-all --base-path=. .

# On the other side
git pull git://<source-ip>

Published on 2025-12-04 #git - In code