Warning
The use of flags is deprecated! All configuration using environment variables only!
♻️ Easy to use and stable update of your repository.
Real-time local repository update (every N time):
Auth
- Authorization by HTTP (login/password) or SSH (private key);Clone
- When starting, it checks the presence of the repository at the specified path (if the repository already exists, it starts checking for updates, if not, it will first clone);Fetch
- Checks repository updates every N time;Pull
- As soon as the remote repository is updated - makes pull in the specified directory.
git clone https://github.com/eikoshelev/git-sync.git
cd git-sync && go build ./cmd/git-sync
./git-sync
You can run it like this:
docker run -d --name git-sync eikoshelev/git-sync:v2.0.0
..or build your own container:
git clone https://github.com/eikoshelev/git-sync.git
cd git-sync && docker build -t eikoshelev/git-sync:v2.0.0 --platform <OS>/<ARCH> .
Environment variable | Description |
---|---|
GSYNC_REPO_URL |
URL to remote repository, example: git@github.com:eikoshelev/git-sync.git (SSH),https://github.com/eikoshelev/git-sync.git (HTTP) |
GSYNC_REPO_LOCAL_PATH |
Path to local directory for repository: /path/to/your/local/directory |
GSYNC_FETCH_TIMEOUT |
Timeout for check update (fetch), default 5m , for example 1s , 2m , 3h , etc. |
GSYNC_SSH_KEY_PATH |
Path to private SSH key for auth to the remote repository, default /$HOME/.ssh/id_rsa |
GSYNC_SSH_KNOWN_HOSTS |
Path to known_hosts file for work with remote repository, default /$HOME/.ssh/known_hosts |
GSYNC_HTTP_LOGIN |
Login for HTTP auth to the remote repository |
GSYNC_HTTP_PASSWORD |
Password for HTTP auth to the remote repository |
GSYNC_FORCE_PULL |
Forced pull with changed local repository: allowed - true , not allowed - false (default) |
GSYNC_REPO_BRANCH |
Remote branch for pull, for example: main , develop , etc. NOTE: If the 'tag' is specified, the 'branch' will be ignored! |
GSYNC_REPO_TAG |
Remote tag for clone, for example: "v1.0.0" , "v2.0-rc" , "v3.0-stable" , etc. NOTE: If the 'tag' is specified, the specified 'branch' will be ignored! |
Open an issue or PR if you have more suggestions, questions or ideas about what to add.