serve-git
Temporarily share a local Git repository with a peer over the internet.
serve-git starts a read-only Git smart HTTP server for a local worktree or bare
repository, opens an ngrok HTTPS tunnel to it, and prints
ready-to-run git clone and git remote add commands. stop-serve-git tears
everything down.
There is no authentication: anyone who has the URL can clone or fetch while the tunnel is running.
Requirements
- Python 3.10+
gitwithgit-http-backendngrokonPATH, already authenticated (ngrok config check)
Install
With pipx (recommended)
pipx install serve-git
Or install directly from GitHub:
pipx install git+https://github.com/pablogventura/serve-git.git
This installs the serve-git and stop-serve-git commands globally in an isolated environment.
Upgrade later with:
pipx upgrade serve-git
Editable install (development)
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Without packaging
Add the bin/ directory to your PATH:
export PATH="/path/to/serve-git/bin:$PATH"
Usage
On your machine:
serve-git /path/to/local/repo
Example output:
Share these commands with your peer:
# Clone into a new directory
git -c http.extraHeader="ngrok-skip-browser-warning:true" clone https://xxxx.ngrok-free.app/my-repo.git
# Or add as a remote on an existing clone
git remote add serve-git https://xxxx.ngrok-free.app/my-repo.git
git -c http.extraHeader="ngrok-skip-browser-warning:true" fetch serve-git
When finished on your machine, run: stop-serve-git
The http.extraHeader value skips ngrok's free-tier browser warning page so Git
HTTP clients can talk to the tunnel.
When you are done:
stop-serve-git
Only one serve session is supported at a time. Push is disabled (read-only).
Tests
pip install -e ".[dev]"
pytest
Tests exercise repository resolution, session state, command formatting, ngrok
API parsing (mocked), and a real git clone against the local smart HTTP server.
They do not open a live ngrok tunnel.
Manual ngrok check
serve-git /path/to/repo
# on another machine or after copying the printed URL:
# git -c http.extraHeader="ngrok-skip-browser-warning:true" clone <url>
stop-serve-git
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file serve_git-0.1.0.tar.gz.
File metadata
- Download URL: serve_git-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fd4829a74690fb216cf414cea76c017fe6ef61f2c1200ed3349aa5ffc3a1778
|
|
| MD5 |
3a52be98847ebece03479f5df017187e
|
|
| BLAKE2b-256 |
4e4393e0c748c8b60bce92ee67c5de4fd9d7cc7674c01ecab829263732f05a4f
|
File details
Details for the file serve_git-0.1.0-py3-none-any.whl.
File metadata
- Download URL: serve_git-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b08a300eaf05ee80cf12feb7051614cbe2917e4c303110561e5d82e6c4a2182
|
|
| MD5 |
2f19c9a54015220f02e6566b90e788ab
|
|
| BLAKE2b-256 |
45c7efe9ea164895f22c445466b1c8fd14f83a9eb71fe09107644b19598515d4
|