You Already Have a Git Server

You Already Have a Git Server

2025-10-24 — 2026-01-26

If you have a git repository on a server with ssh access, you can just clone it:

git clone ssh://username@hostname/path/to/repo

Once you've done some work, you can push your changes back to the origin server. By default, git won't let you push to the branch that is currently checked out, but this is easy to change:

Run this on the remote server.

git config receive.denyCurrentBranch updateInstead

This is a nice way to work on server-side files without SSH lag or error-prone copying. If you need more then just a file server, git can run a shell script when it receives a new push:

cat > .git/hooks/post-update <<EOF #!/bin/sh set -euo pipefail cd /path/to/site /path/to/generator EOF chmod a+x .git/hooks/post-update

You'll even get the script's output sent back to your computer's terminal. . I've have git set up to this blog's site generator: It's very nice to be able to type up posts locally, and then push them to the server.

It's also backed up by default: If the server breaks, I've still got the copy on my laptop, and if my laptop breaks, I can download everything from the server.
Available Now

Get GoPeek

Preview links without opening tabs. Available on Edge and Firefox. Chrome support coming soon.

Comments

Popular posts from this blog

Claude Opus 4.5 vs GLM-5.2