Skip to main content
The wit serve command starts a Git HTTP server for hosting repositories. For a complete platform setup including database and web UI, use wit up instead.

Overview

Options

Examples

Example Output


Environment Variables


What wit serve Provides

The server exposes:

Git HTTP Protocol

  • Clone: wit clone http://localhost:3000/owner/repo.git
  • Push: wit push origin main
  • Fetch: wit fetch origin

REST API

  • Repository management
  • User authentication
  • Pull request operations

tRPC API

  • Full platform functionality
  • Real-time updates
  • Type-safe client access

Use Cases

Development Server

Run a local server for development:

CI/CD Integration

Use as a Git server in CI pipelines:

Self-Hosted Git Server

Run a persistent Git server:

wit serve vs wit up

Use wit serve when:
  • You have an external database
  • You only need the API server
  • You’re deploying to production with custom orchestration
Use wit up when:
  • You want everything started automatically
  • You’re developing locally
  • You need the web UI

Graceful Shutdown

The server handles shutdown signals properly:
This ensures:
  • In-flight requests complete
  • Database connections close cleanly
  • Resources are released

Troubleshooting

Either stop the other process or use a different port:
Find what’s using the port:
Ensure DATABASE_URL is set and the database is running:
Ensure the repos directory exists and is writable:

  • wit up - Start full platform (recommended for local development)
  • wit down - Stop the platform
  • wit clone - Clone from the server
  • wit push - Push to the server