Git Guardian is a simple yet powerful CLI tool to automatically back up your project folders to GitHub. Designed for Mac users, Guardian watches your directories for changes or backs them up on a regular interval, committing and pushing changes automatically. It's perfect for developers who want effortless version control without thinking about it.
- Auto-Backup: Automatically commit and push changes to a GitHub repository.
- Watch Mode: Monitor a folder for file changes and push updates with a configurable debounce time (e.g., every 30 seconds).
- Interval Mode: Push all changes at a set interval (e.g., every 10 seconds to 5 minutes or more).
- Folder Management: Link folders to Guardian with simple, user-friendly incremental IDs (1, 2, 3...).
- Colorful CLI: Beautiful, color-coded terminal output with status indicators and icons.
- Listeners Dashboard: View all active watchers with detailed info including mode, interval/debounce times, and last run timestamps.
- Flexible Paths: Use relative paths (
.,..) or absolute paths for linking and starting watchers. - Autostart: Guardian can start automatically when your Mac boots via launchd.
- Safe and Reliable: Stops watchers if a folder is deleted and prevents duplicate or conflicting commits.
- Background Daemon: Runs silently in the background, automatically managing all your linked folders.
brew tap itzcodex24/tap
brew install guardian- Clone the repository:
git clone https://github.com/itzcodex24/git-guardian.git
cd git-guardian- Build the CLI tool:
go build -o guardian ./...- Move it to your
PATHfor global access:
sudo mv guardian /usr/local/bin/guardian initguardian link ~/Projects/myproject- Watch mode (on change):
guardian start ~/Projects/myproject --watch --debounce 30s- Interval mode (every 5 minutes):
guardian start ~/Projects/myproject --interval 5mguardian listeners # List active watchers
guardian pause <id> # Pause a watcher
guardian resume <id> # Resume a watcher
guardian remove <id> # Remove a watcherguardian autostart enable
guardian autostart disableGit Guardian is open source! Your feedback, bug reports, and contributions are highly appreciated. Let’s make automatic Git backups easier for everyone!
We welcome contributions! Here’s how you can collaborate:
- Fork the repository and create a feature branch:
git checkout -b feature/my-awesome-feature- Write code and tests for your feature.
- Commit changes with clear messages:
git commit -m "Add feature X with Y improvements"- Push to your fork and open a pull request.
- Code review: PRs will be reviewed, and feedback may be requested before merging.
- Issues: Report bugs or suggest features via GitHub Issues.
Code Style:
- Follow Go conventions (
gofmt,golint) - Keep commits focused and atomic
- Document public functions and methods clearly