Git Sync Service

A service for synchronizing Git repositories across different platforms.
Features
- Multi-platform Git synchronization
- Scheduled sync with cron support
- Webhook-based real-time sync
- RESTful API for manual operations
- SQLite and MySQL database support
Installation
From Release
Download the latest binary from Releases.
From Source
git clone https://github.com/yi-nology/git-sync-service.git
cd git-sync-service
go build -o git-sync-service .
Usage
# Run the service
./git-sync-service
# Or use make
make run
Configuration
Environment Variables
The following environment variables are required:
| Variable |
Required |
Description |
ENCRYPTION_KEY |
Yes |
Encryption key for credential storage (AES-256-GCM). Min 1 byte; keys shorter than 32 bytes are hashed via SHA-256. |
Create a .env file from the example:
cp .env.example .env
# Edit .env and set ENCRYPTION_KEY
Generate a secure key:
openssl rand -base64 32
Config File
Create a conf/config.yaml file with your configuration:
server:
host: "0.0.0.0"
port: 8890
database:
driver: sqlite
source: "data/git-sync.db"
Development
# Install dependencies
go mod tidy
# Run tests
make test
# Build
make build
# Lint (requires golangci-lint)
golangci-lint run
API Documentation
Once the server is running, access the API at http://localhost:8890.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project Stats
| Metric |
Value |
| Test Files |
12 |
| Total Tests |
97 |