git-sync-manager

Multi-repository git synchronization and fetch-pull-push patterns for batch operations across workspaces

5 stars

Best use case

git-sync-manager is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Multi-repository git synchronization and fetch-pull-push patterns for batch operations across workspaces

Teams using git-sync-manager should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/git-sync-manager/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_core/bash/git-sync-manager/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/git-sync-manager/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How git-sync-manager Compares

Feature / Agentgit-sync-managerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Multi-repository git synchronization and fetch-pull-push patterns for batch operations across workspaces

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Git Sync Manager

## When to Use This Skill

✅ **Use when:**
- Managing multiple Git repositories from a central location
- Performing batch git operations (pull, commit, push)
- Need consistent sync workflows across many repos
- Automating daily/periodic repository synchronization
- Building repository management CLIs

❌ **Avoid when:**
- Single repository operations
- Complex merge/rebase workflows requiring manual intervention
- Repositories with conflicting changes that need resolution

## Large-Repo / Concurrent-Agent Safety Rules

When syncing very large repos or repos actively handled by Codex/Codex/Gemini workers:

1. **Preflight active writers first**: inspect `ps`/`/proc/<pid>/cwd` for active `Codex`, `codex`, `git checkout`, `git status`, `git commit`, `git merge`, `git rebase`, `git pull`, or `git push` processes. If a worker is operating inside the target repo, do not interrupt it or mutate that repo.
2. **Use no-untracked status by default**: prefer `git -c status.showUntrackedFiles=no status --short --branch --untracked-files=no`; never use `git status -uall` on huge repos unless explicitly justified.
3. **Respect locks**: treat `.git/index.lock`, `.git/HEAD.lock`, `MERGE_HEAD`, `rebase-merge/`, and `rebase-apply/` as stop signs. Do not delete locks automatically during scheduled sync.
4. **Backup before staging**: for dirty tracked changes, write `git diff --binary HEAD` and no-untracked status output under `.git/recovery-backups/` before `git add -u`.
5. **Prefer fast-forward-only pulls**: use `git fetch origin --prune` then `git pull --ff-only`/`git pull --ff-only origin <default-branch>`; do not use scheduled `--rebase --autostash` when concurrent workers may exist.
6. **Sparse checkout**: if a path exists on GitHub but is missing locally, use `git ls-tree origin/<branch> <path>` then `git sparse-checkout add <path>`. Do not run `git sparse-checkout disable` on very large repos without explicit approval; it can materialize hundreds of thousands of files and hold the index lock for a long time.

## Complete Example: Repository Sync CLI

Full implementation combining all patterns:

```bash
#!/bin/bash
# ABOUTME: Complete multi-repository sync manager
# ABOUTME: Provides pull, commit, push, sync, and status operations

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE_ROOT="${WORKSPACE_ROOT:-$(dirname "$SCRIPT_DIR")}"

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'

# ─────────────────────────────────────────────────────────────────
# Repository Discovery
# ─────────────────────────────────────────────────────────────────

declare -a REPOS=()
declare -A CATEGORIES=()

*See sub-skills for full details.*

## Resources

- [Git Reference](https://git-scm.com/docs)
- [Bash Arrays](https://www.gnu.org/software/bash/manual/html_node/Arrays.html)
- [Associative Arrays in Bash](https://www.gnu.org/software/bash/manual/html_node/Arrays.html)

---

## Version History

- **1.0.0** (2026-01-14): Initial release - extracted from workspace-hub repository sync scripts

## Sub-Skills

- [1. Repository Discovery from .gitignore](1-repository-discovery-from-gitignore/SKILL.md)
- [2. Multi-Phase Sync Pattern](2-multi-phase-sync-pattern/SKILL.md)
- [3. Repository Status Check (+1)](3-repository-status-check/SKILL.md)
- [5. Safe Branch Operations](5-safe-branch-operations/SKILL.md)
- [1. Always Check Before Operating (+4)](1-always-check-before-operating/SKILL.md)

Related Skills

state-directory-manager

5
from vamseeachanta/workspace-hub

Manage persistent state directories with XDG-compliant paths and cleanup for bash scripts

xurl

5
from vamseeachanta/workspace-hub

X/Twitter via xurl CLI: post, search, DM, media, v2 API.

xitter

5
from vamseeachanta/workspace-hub

Interact with X/Twitter via the x-cli terminal client using official X API credentials. Use for posting, reading timelines, searching tweets, liking, retweeting, bookmarks, mentions, and user lookups.

research-paper-writing

5
from vamseeachanta/workspace-hub

End-to-end pipeline for writing ML/AI research papers — from experiment design through analysis, drafting, revision, and submission. Covers NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Integrates automated experiment monitoring, statistical analysis, iterative writing, and citation verification.

cli-productivity

5
from vamseeachanta/workspace-hub

Essential CLI tools and shell productivity patterns for efficient terminal workflows

usage-tracker

5
from vamseeachanta/workspace-hub

Track and analyze usage metrics with timestamped logging, reporting, and trend detection

parallel-batch-executor

5
from vamseeachanta/workspace-hub

Parallel task execution patterns using xargs and job control for significant performance gains

json-config-loader

5
from vamseeachanta/workspace-hub

Configuration file parsing patterns for bash scripts (INI, key=value, JSON)

interactive-menu-builder

5
from vamseeachanta/workspace-hub

Build multi-level interactive CLI menus with navigation and selection for bash scripts

complexity-scorer

5
from vamseeachanta/workspace-hub

Score task complexity using keyword matching, heuristic analysis, and configurable threshold rules

bash-cli-framework

5
from vamseeachanta/workspace-hub

Universal bash CLI patterns for colors, logging, headers, and error handling

worktree-branch-sync-hygiene

5
from vamseeachanta/workspace-hub

Class-level branch, worktree, dirty-main, stash, sync, and hook hygiene for workspace-hub style multi-repo work.