{"id":28709058,"url":"https://github.com/eikoshelev/git-sync","last_synced_at":"2025-06-14T19:39:49.054Z","repository":{"id":64304919,"uuid":"149531461","full_name":"eikoshelev/git-sync","owner":"eikoshelev","description":"Keeps local repository up to date","archived":false,"fork":false,"pushed_at":"2023-04-19T06:41:23.000Z","size":20162,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-20T15:46:27.273Z","etag":null,"topics":["clone","docker","fetch","git","git-sync","golang","pull","synchronization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eikoshelev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-20T01:06:00.000Z","updated_at":"2023-04-19T06:51:50.000Z","dependencies_parsed_at":"2024-06-20T15:42:38.993Z","dependency_job_id":null,"html_url":"https://github.com/eikoshelev/git-sync","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/eikoshelev/git-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eikoshelev%2Fgit-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eikoshelev%2Fgit-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eikoshelev%2Fgit-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eikoshelev%2Fgit-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eikoshelev","download_url":"https://codeload.github.com/eikoshelev/git-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eikoshelev%2Fgit-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259872859,"owners_count":22924650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clone","docker","fetch","git","git-sync","golang","pull","synchronization"],"created_at":"2025-06-14T19:39:48.366Z","updated_at":"2025-06-14T19:39:49.044Z","avatar_url":"https://github.com/eikoshelev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-sync\n\n\u003e **Warning**  \n\u003e The use of flags is deprecated! All configuration using environment variables only!\n\n:recycle: Easy to use and stable update of your repository.\n  \n![alt text](assets/git-sync.png)\n  \n### Description\n  \nReal-time local repository update (every N time):\n\n0. `Auth` - Authorization by HTTP (login/password) or SSH (private key);\n1. `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);\n2. `Fetch` - Checks repository updates every N time;\n3. `Pull` - As soon as the remote repository is updated - makes pull in the specified directory.\n\n### Build and run locally\n\n```bash\ngit clone https://github.com/eikoshelev/git-sync.git\n```\n\n```bash\ncd git-sync \u0026\u0026 go build ./cmd/git-sync\n```\n\n```bash\n./git-sync\n```\n\n### Docker container\n\nYou can run it like this:\n\n```bash\ndocker run -d --name git-sync eikoshelev/git-sync:v2.0.0\n```\n\n..or build your own container:\n\n```bash\ngit clone https://github.com/eikoshelev/git-sync.git\n```\n\n```bash\ncd git-sync \u0026\u0026 docker build -t eikoshelev/git-sync:v2.0.0 --platform \u003cOS\u003e/\u003cARCH\u003e .\n```\n\n### Usage\n  \n| **Environment variable** | **Description** |\n| :--- | :--- |\n|`GSYNC_REPO_URL`        | URL to remote repository, example: `git@github.com:eikoshelev/git-sync.git` (SSH),`https://github.com/eikoshelev/git-sync.git` (HTTP)\n|`GSYNC_REPO_LOCAL_PATH` | Path to local directory for repository: `/path/to/your/local/directory`\n|`GSYNC_FETCH_TIMEOUT`   | Timeout for check update (fetch), default `5m`, for example `1s`, `2m`, `3h`, etc.\n|`GSYNC_SSH_KEY_PATH`    | Path to **private SSH key** for auth to the remote repository, default `/$HOME/.ssh/id_rsa`\n|`GSYNC_SSH_KNOWN_HOSTS` | Path to **known_hosts** file for work with remote repository, default `/$HOME/.ssh/known_hosts`\n|`GSYNC_HTTP_LOGIN`      | Login for HTTP auth to the remote repository\n|`GSYNC_HTTP_PASSWORD`   | Password for HTTP auth to the remote repository\n|`GSYNC_FORCE_PULL`      | Forced pull with changed local repository: allowed - `true`, not allowed - `false` (default)\n|`GSYNC_REPO_BRANCH`     | Remote branch for pull, for example: `main`, `develop`, etc. **NOTE: If the 'tag' is specified, the 'branch' will be ignored!**\n|`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!**\n\n### What else?\n\nOpen an issue or PR if you have more suggestions, questions or ideas about what to add.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feikoshelev%2Fgit-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feikoshelev%2Fgit-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feikoshelev%2Fgit-sync/lists"}