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
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:- In-flight requests complete
- Database connections close cleanly
- Resources are released
Troubleshooting
Port already in use
Port already in use
Database connection failed
Database connection failed
DATABASE_URL is set and the database is running:Permission denied on repos directory
Permission denied on repos directory