Sign inSign up

xt10r/git-sync

By xt10r

•Updated over 2 years ago

Tool for automatic synchronization of a local Git repository with a remote one

Image
Developer tools
0

950

xt10r/git-sync repository overview

⁠Git Sync

Git Sync is a lightweight service designed to keep a local directory in sync with a remote Git repository. It periodically pulls changes from the remote repository and ensures the local directory is up-to-date. This service supports synchronization intervals, HTTP server with basic authentication, and multi-platform builds.

⁠Key Features

Periodic Synchronization: Automatically sync a local directory with a remote Git repository at specified intervals.
Webhook Trigger: Support for triggering synchronization via webhooks. HTTP Server: Provides an HTTP server with basic authentication and custom token authentication.
Multi-Platform Support: Supports Linux, Windows, and macOS platforms.
Improved Logging: Enhanced logging messages for better traceability and debugging.

⁠Usage

⁠Environment Variables

VariableDescriptionDefault
GITSYNC_REPOSITORY_URLURL of the remote Git repository""
GITSYNC_REPOSITORY_BRANCHBranch of the remote Git repository"main"
GITSYNC_LOCAL_PATHLocal path to sync with the repository"/git"
GITSYNC_INTERVALSynchronization interval"30s"
GITSYNC_HTTP_SERVER_ADDRAddress for the HTTP server"0.0.0.0:8080"
GITSYNC_HTTP_AUTH_USERNAMEUsername for HTTP server basic auth""
GITSYNC_HTTP_AUTH_PASSWORDPassword for HTTP server basic auth""
GITSYNC_HTTP_AUTH_TOKENToken for HTTP server custom auth""
GITSYNC_REPOSITORY_USERUsername for repository authentication""
GITSYNC_REPOSITORY_TOKENToken for repository authentication""

⁠Running the Container

⁠Only Sync
docker run -d \
    -e GITSYNC_REPOSITORY_URL="https://your-repo-url.git" \
    -e GITSYNC_REPOSITORY_BRANCH="main" \
    -e GITSYNC_INTERVAL="10s" \
    -v /path/to/local/repo/:/git \
    xt10r/git-sync:latest
⁠With Repo Auth
docker run -d \
    -e GITSYNC_REPOSITORY_URL="https://your-repo-url.git" \
    -e GITSYNC_REPOSITORY_BRANCH="main" \
    -e GITSYNC_INTERVAL="10s" \
    -e GITSYNC_REPOSITORY_USER="your-repo-username" \
    -e GITSYNC_REPOSITORY_TOKEN="your-repo-token" \
    -v /path/to/local/repo/:/git \
    xt10r/git-sync:latest
⁠With HTTP Server Basic Auth
docker run -d \
    -e GITSYNC_REPOSITORY_URL="https://your-repo-url.git" \
    -e GITSYNC_REPOSITORY_BRANCH="main" \
    -e GITSYNC_INTERVAL="30s" \
    -e GITSYNC_HTTP_SERVER_ADDR="0.0.0.0:8080" \
    -e GITSYNC_HTTP_AUTH_USERNAME="your-username" \
    -e GITSYNC_HTTP_AUTH_PASSWORD="your-password" \
    -e GITSYNC_REPOSITORY_USER="your-repo-username" \
    -e GITSYNC_REPOSITORY_TOKEN="your-repo-token" \
    -v /path/to/local/repo/:/git \
    xt10r/git-sync:latest
⁠With HTTP Server Token Auth
docker run -d \
    -e GITSYNC_REPOSITORY_URL="https://your-repo-url.git" \
    -e GITSYNC_REPOSITORY_BRANCH="main" \
    -e GITSYNC_INTERVAL="30s" \
    -e GITSYNC_HTTP_SERVER_ADDR="0.0.0.0:8080" \
    -e GITSYNC_HTTP_AUTH_TOKEN="your-token" \
    -e GITSYNC_REPOSITORY_USER="your-repo-username" \
    -e GITSYNC_REPOSITORY_TOKEN="your-repo-token" \
    -v /path/to/local/repo/:/git \
    xt10r/git-sync:latest

⁠Contributing

We welcome contributions to enhance the functionality of git-sync. Please open issues and pull requests on our GitHub repository⁠.

⁠License

git-sync is licensed under the Apache 2.0 License⁠.

Tag summary

Content type

Image

Digest

sha256:03629295c…

Size

13.3 MB

Last updated

over 2 years ago

docker pull xt10r/git-sync