Automatically commit, rebase, push, and notify across many local Git repositories.
Personal machines often hold many small active repositories. git-auto-sync keeps them clean without turning git add -A && git commit && git push into a risky cron job. It can ask an AI provider to stage only reasonable files, generate a Conventional Commits message, push safely, and notify when something changed or failed.
- Multi-repo scheduler - scan and sync configured repositories on macOS, Linux, or Windows.
- Smart staging - AI selects commit candidates and excludes secrets, build output, logs, binaries, and large files.
- Path policies - allowlist or exclude paths with gitignore-style patterns before staging.
- Bare work tree support - sync
git_dirpluswork_treerepositories, including config repos outside a normal.gitdirectory. - Safe fallback - when AI is unavailable, rule-based staging still keeps common junk out.
- Conventional commits - generate commit messages from the selected diff.
- Conflict isolation - failed pull/rebase in one repo does not stop the rest.
- Pluggable notifications - log, Telegram, and Feishu/Lark webhook notifiers.
- Dry-run mode - preview candidates without committing or pushing.
- One-line install - installer sets up
uv, release files, config, and command launcher.
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/OctopusGarage/git-auto-sync/main/install.sh | bashWindows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/OctopusGarage/git-auto-sync/main/install.ps1 | iex"Then run the guided setup:
git-auto-sync init
git-auto-sync sync --dry-run
git-auto-sync syncFor each configured repository:
- Skip clean repositories.
- Select safe files to stage.
- Generate a Conventional Commits message.
- Commit.
- Pull with rebase.
- Push.
- Notify according to the configured strategy.
If any step fails, that repository is marked failed and the next repository continues.
git-auto-sync init
git-auto-sync status
git-auto-sync sync
git-auto-sync sync --repo my-project
git-auto-sync sync --dry-run
git-auto-sync config check
git-auto-sync install --interval 30m
git-auto-sync uninstall
git-auto-sync updateDefault config path:
~/.git-auto-sync/config.toml
Start from the example:
mkdir -p ~/.git-auto-sync
cp config.example.toml ~/.git-auto-sync/config.toml
git-auto-sync config checkCore options:
| Setting | Purpose |
|---|---|
[[repos]] |
Repositories to scan and sync. |
ai_provider |
claude-cli, anthropic-api, or rules. |
notify_on |
change_or_fail, fail_only, or always. |
| notifiers | log, telegram, and lark. |
Path policies are optional for normal repositories:
[[repos]]
path = "~/programming/docs"
[repos.path_policy]
mode = "allowlist"
include = ["README.md", "docs/**"]
exclude = ["*.log", ".env*"]
builtin_deny = truegit_dir plus work_tree repositories are also supported. This mode always
requires path_policy.mode = "allowlist" with include or include_file:
[[repos]]
name = "home-config"
path = "~"
git_dir = "~/.homegit.git"
work_tree = "~"
ai_staging = false
[repos.path_policy]
mode = "allowlist"
include_file = "~/.homegitinclude"
exclude_file = "~/.homegitignore"
builtin_deny = trueIf the effective work tree is the user's home directory, the same allowlist
requirement is enforced even when git_dir is not configured.
git-auto-sync install creates a platform-native schedule:
| Platform | Mechanism |
|---|---|
| macOS | launchd user agent |
| Linux | systemd --user timer |
| Windows | Task Scheduler |
No long-running daemon is required.
On macOS, the generated launchd agent sets a stable PATH that includes
Homebrew locations, so Git hooks and filters such as git-lfs and git-crypt
work the same way they do in an interactive shell. git-auto-sync config check
also reports missing runtime tools for configured repos before a scheduled sync
hits them.
- Secret-like files, certificates, build artifacts, dependency folders, logs, and large binaries are excluded from staging.
- When a path policy is configured, AI staging can only choose from files already approved by that policy.
git_dirpluswork_treerepositories and home-directory work trees must use an allowlist policy.- Excluded paths can be written to
.gitignorewhenai_gitignore_autowrite=true. --dry-runshows what would happen before any commit or push.- Pull conflicts abort cleanly and do not continue into a risky push.
uv sync
uv run pytest
uv run ruff check .See release.md for the release runbook and package asset rules.
- tmux-claude-bot - remote-control local coding agents in tmux.
- OctopusGarage - small tools for AI agents, local automation, and browser-native products.
MIT