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
Metadata
Release files for serve-git 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| serve_git-0.1.0.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| serve_git-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.3 kB
Release files / serve_git-0.1.0.tar.gz
| Download URL | serve_git-0.1.0.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fd4829a74690fb216cf414cea76c017fe6ef61f2c1200ed3349aa5ffc3a1778
|
|
BLAKE2b-256 checksum How to use checksums |
4e4393e0c748c8b60bce92ee67c5de4fd9d7cc7674c01ecab829263732f05a4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / serve_git-0.1.0-py3-none-any.whl
| Download URL | serve_git-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b08a300eaf05ee80cf12feb7051614cbe2917e4c303110561e5d82e6c4a2182
|
|
BLAKE2b-256 checksum How to use checksums |
45c7efe9ea164895f22c445466b1c8fd14f83a9eb71fe09107644b19598515d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|