minimal git server in rust implementing the smart http protocol. handles git push, pull, and fetch operations over http with bare repository storage.
cargo build --release
# set repos directory (default: /tmp/box-repos)
export REPOS_DIR=/tmp/box-repos
# start server without authentication (development)
cargo run
# start server with authentication (production)
REQUIRE_AUTH=true IDENTITY_URL=http://localhost:8504 cargo run
# custom port
PORT=8080 cargo run
# create a repository
curl -X POST http://localhost:9418/api/repos/alice/mystore
# clone it
git clone http://localhost:9418/alice/mystore.git
# push code
cd mystore
echo "# test" > README.md
git add README.md
git commit -m "initial commit"
git push origin main
GET /:user/:repo/info/refs?service=git-receive-pack - advertise refs for pushPOST /:user/:repo/git-receive-pack - receive pack (git push)POST /:user/:repo/git-upload-pack - send pack (git pull/fetch)POST /api/repos/:user/:repo - create repositoryGET /api/repos/:user - list user's repositoriesGET /health - health check# run with debug logging
RUST_LOG=box_git=debug cargo run
# run tests
cargo test
# format code
cargo fmt
# lint
cargo clippy
minimal git server in rust implementing the smart http protocol. handles git push, pull, and fetch operations over http with bare repository storage.
cargo build --release
# set repos directory (default: /tmp/box-repos)
export REPOS_DIR=/tmp/box-repos
# start server without authentication (development)
cargo run
# start server with authentication (production)
REQUIRE_AUTH=true IDENTITY_URL=http://localhost:8504 cargo run
# custom port
PORT=8080 cargo run
# create a repository
curl -X POST http://localhost:9418/api/repos/alice/mystore
# clone it
git clone http://localhost:9418/alice/mystore.git
# push code
cd mystore
echo "# test" > README.md
git add README.md
git commit -m "initial commit"
git push origin main
GET /:user/:repo/info/refs?service=git-receive-pack - advertise refs for pushPOST /:user/:repo/git-receive-pack - receive pack (git push)POST /:user/:repo/git-upload-pack - send pack (git pull/fetch)POST /api/repos/:user/:repo - create repositoryGET /api/repos/:user - list user's repositoriesGET /health - health check# run with debug logging
RUST_LOG=box_git=debug cargo run
# run tests
cargo test
# format code
cargo fmt
# lint
cargo clippy