Skip to content

cloudgen/git-sync

Repository files navigation

git-sync

Version License CIAO ShellParser Shell

Officially reviewed and recommended by grok. Please see the download copy

Simple, defensive, self-installing tool that resets and pulls all Git repositories in a folder.

One single POSIX shell file. Zero dependencies. Perfect curl | sh experience.


Features

  • Scans direct subfolders for .git repositories
  • Performs safe git reset --hard HEAD + git pull origin main
  • Full self-install / self-update / self-uninstall with checksum verification (v2)
  • Multi-shell PATH support (bash, zsh, fish)
  • --json and --quiet modes
  • Root and user installation support
  • Built with strict CIAO principles
  • Developed using ShellParser for safe modular editing

Installation

Most Secure (Recommended)

CHECKSUM="cf9e38c00da50efd3d83a57a16d05829cf39901506334c0249f06c6c0ee7ce28" \
  curl -fsSL https://raw.githubusercontent.com/cloudgen/git-sync/main/git-sync | sh

Standard One-liner

curl -fsSL https://raw.githubusercontent.com/cloudgen/git-sync/main/git-sync | sh

Current official SHA256 (v1.0.8):
cf9e38c00da50efd3d83a57a16d05829cf39901506334c0249f06c6c0ee7ce28


Usage

git-sync                    # Sync all Git repos in current directory
git-sync ~/projects         # Sync all repos under ~/projects/
git-sync /path/to/folder    # Custom directory

# Additional commands
git-sync help               # Show help
git-sync version            # Show version
git-sync about              # Diagnostics (install status, shell, etc.)
git-sync self-update        # Update to latest version
git-sync self-uninstall     # Remove from system
git-sync --json             # Machine-readable JSON output

Development Workflow (ShellParser)

This project is maintained using ShellParser — allowing safe modular development while keeping a perfect single-file curl | sh experience.

See full instructions in ShellParser.skill.

Quick commands:

# 1. Install ShellParser
pip install ShellParser

# 2. Split into small editable files
shell-parser split git-sync

# 3. Edit a component
# → target/components/git_sync_main_loop.sh

# 4. Sync change back
shell-parser replace git-sync git_sync_main_loop

Philosophy

git-sync follows the CIAO defensive programming philosophy:

Caution • Intentional • Anti-fragile • Over-protect

Every critical section is heavily guarded with protection zones, clear intent, and safety checks.


Files of Interest


Related Projects

  • grokrec — CIAO-compliant Grok code review prompt generator
  • countdown — CIAO-based Pomodoro timer
  • CIAO — The defensive philosophy behind this project

Made with ❤️ and strict CIAO + ShellParser principles.

Defensive by design. Anti-fragile by intention.


License: MIT

About

Scans direct subfolders for Git repos (.git), resets --hard HEAD, pulls origin main. Portable, self-installing — works via curl | sh on Linux/macOS/Alpine/BSD.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages