A minimal, "single-serving" Git HTTP server for
- Emergencies
- Local, ad hoc experimentation
- Git education
Normal, everyday use is not recommended unless security and performance are non-issues. Requires a normal Git installation. There's really no need to git clone
or pip install
since this thing is a single file. See --help
for available options.
- Update 2019
This project has been retired. PM if you want the PyPI name.
- Use case
Some VM or container in which SSH/NFS/SMB aren't desired and for which folder sharing or volume mapping aren't worth configuring
- On the host
laptop:~$ curl -L "$github_raw_url" | python3 - ./www Serving over port 8000 ...
- On the client
[my_vm]# git clone http://laptop.local:8000/repos/my_repo.git Cloning ...
- Some caveats
- Your network setup might require that you provide an IP address (perhaps of a bridge) in place of
localhost
orlaptop.local
. Export that (or0.0.0.0
) as_HOST
to the server's environment. The target repo on the server must be named
*.git
. If it's beneath a working directory and you don't want a leaf named.git
, use a symlink:~/ └── www/ └── repos/ ├── my_repo.git -> ./my_repo/.git └── my_repo/ ├── ... └── .git/
Non-bare repos must have the
receive.denyCurrentBranch
option set toupdateInstead
in order to receive pushes and update the working directory. (The same applies to any transport when the pushed branch is checked out on the receiving end.)laptop:my_repo$ git config --add receive.denyCurrentBranch "updateInstead"
- Your network setup might require that you provide an IP address (perhaps of a bridge) in place of
A Docker image is available at https://hub.docker.com/r/shaaraddalvi/emergency-git-server.
The server loads its content root at /repos directory which corresponds to the 'www' directory shown in examples above. You can mount your www equivalent directory there as shown below. The server exposes port 8000
that can be mapped to port of your choice.
- Example usage -
docker run -it --rm -v /path/to/www/as/above:/repos -p 8000:8000 shaaraddalvi/emergency-git-server:latest