{"id":27991654,"url":"https://github.com/lucaspar/git-sync","last_synced_at":"2026-04-29T00:31:33.715Z","repository":{"id":291641185,"uuid":"976887079","full_name":"lucaspar/git-sync","owner":"lucaspar","description":"Automated git synchronization","archived":false,"fork":false,"pushed_at":"2025-05-05T18:58:17.000Z","size":125,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T17:47:58.758Z","etag":null,"topics":["autocommit","commit","git","git-fire","git-sync","synchronization","wip"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucaspar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-05-03T00:08:40.000Z","updated_at":"2025-05-05T18:58:20.000Z","dependencies_parsed_at":"2025-05-05T19:55:54.086Z","dependency_job_id":"50881787-8cf8-4748-ac0f-5a1603d56393","html_url":"https://github.com/lucaspar/git-sync","commit_stats":null,"previous_names":["lucaspar/git-sync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucaspar/git-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaspar%2Fgit-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaspar%2Fgit-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaspar%2Fgit-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaspar%2Fgit-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucaspar","download_url":"https://codeload.github.com/lucaspar/git-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaspar%2Fgit-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32405901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["autocommit","commit","git","git-fire","git-sync","synchronization","wip"],"created_at":"2025-05-08T17:37:50.738Z","updated_at":"2026-04-29T00:31:33.701Z","avatar_url":"https://github.com/lucaspar.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Sync\n\n\u003e Adapted from [this git-sync](https://github.com/simonthum/git-sync).\n\n![in case of fire: git commit, git push, git out](./git-fire.webp)\n\n\u003cdiv style=\"width: 700px; text-align: center;\"\u003e\n    \u003csmall\u003e\n        \u003ca href=\"https://www.printables.com/model/792493-warning-sign-in-case-of-fire-git-commit-git-push-g\"\u003eImage credits\u003c/a\u003e\n    \u003c/small\u003e\n    \u003cbr/\u003e\u003cbr/\u003e\n\u003c/div\u003e\n\n+ `git-sync` synchronizes the current branch to a git remote.\n+ `git-sync` automates git synchronization for repositories that prioritize tracking over maintaining a clean commit history.\n+ `git-sync` is a smarter way to `git add -u; git commit -m \"changes\"; git push` that:\n    + Detects when _not_ to continue e.g. no repo; no remote; during a merge, rebase, or cherry-pick; or when bisecting;\n    + Handles submodules recursively;\n    + Checks for remote ownership to avoid accidentally pushing to third-party repositories;\n    + Has nice human-readable output;\n\n+ [Git Sync](#git-sync)\n    + [Additional features](#additional-features)\n    + [Branch configuration](#branch-configuration)\n    + [Ownership check](#ownership-check)\n\n## Additional features\n\nChanges from the base work include:\n\n+ Fixed shellcheck errors and warnings;\n+ Better repo state handling;\n+ Refactored functions;\n+ Improved output formatting and added colored logs, with `NO_COLOR` respected if set;\n+ Soft remote ownership check to prevent accidentally syncing to a remote not owned by you;\n+ Reduced stdout by using quiet versions of git commands;\n+ Support for bare repos, useful for dotfile repos. Set `GIT_CMD` before running it e.g.:\n    + `GIT_CMD='git --git-dir=${HOME}/.cfg/ --work-tree=${HOME}' git-sync`\n+ Support to recursively sync submodules;\n+ Debug mode to log additional messages.\n\n```log\n$ git-sync --help\n\n Synchronizes the current branch to a git remote.\n\n Usage: git-sync [MODE] [OPTIONS]\n\n\n MODE:\n    sync    Synchronize the current branch to a remote backup (default)\n    check   Verify that the branch is ready to sync\n\n OPTIONS:\n    -h | --help            Show this message.\n    -n | --sync-new-files  Commit new files even if branch.${branch_name}.syncNewFiles isn't set.\n    -s | --sync-branch     Sync the branch even if branch.${branch_name}.sync isn't set.\n    -r | --recursive       Sync submodules recursively.\n    -d | --debug           Debug mode: runs script with added verbosity.\n```\n\n## Branch configuration\n\nThere are three options to use in your `${XDG_CONFIG_HOME}/git/config` or the config of\na specific repository.\n\n+ `branch.$branch_name.syncNewFiles (bool)`\n\n    Tells git-sync to invoke auto-commit even if new (untracked) files are present.\n    Normally, you have to commit those yourself to prevent accidental additions.\n\n+ `branch.$branch_name.syncCommitMsg (string)`\n\n    The default commit message for this branch. When not set, it will default to\n    `\"changes from $(uname -n)\"`.\n\n+ `branch.$branch_name.autoCommitScript (string)`\n\n    Command to perform an auto-commit. e.g. `\"git add -u; git commit -m \\\"%message\\\";\"`.\n    At runtime, `%message` is replaced with the default commit message or with the value\n    for `branch.$branch_name.syncCommitMsg` if set. Pushing is handled by the script.\n\nExample:\n\n```ini\n[branch \"main\"]\n    syncNewFiles = true\n    syncCommitMsg = \"Syncing changes from $(uname -n)\"\n    autoCommitScript = \"git add -u; git commit -m \\\"%message\\\";\"\n```\n\n## Ownership check\n\n`git-sync` attempts to check that the current git user owns the remote we're trying\nto push to. This is a safeguard to prevent accidental pushes to repositories where\na better crafted commit message is likely desired. If the ownership check fails,\nyou will see a message with a few suggestions on how to fix it.\n\nThe ownership check attempts to match the user or organization in the remote's URI with\nthe username of the current git user (the part before the `@` in the email address).\nIf they match, the user is considered the owner of the remote. GitHub and other forges\nprovide a no-reply email address that can be used for commits and will play nicely with\nthis check e.g. `\u003cgithub-user\u003e@users.noreply.github.com`.\n\nThe remote configured as the default for pushes is the one used to match with the\ncurrent user\n\nTo bypass this check at the risk of pushing automated commits to repositories you\ndon't own, you can set the `GIT_SYNC_ALLOW_NONOWNER=1` environment variable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaspar%2Fgit-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucaspar%2Fgit-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaspar%2Fgit-sync/lists"}