Skip to content

itzcodex24/git-guardian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Guardian

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.

🚀 Core Features

  • 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.

💻 Installation

Homebrew (Recommended)

brew tap itzcodex24/tap
brew install guardian

From Source

  1. Clone the repository:
git clone https://github.com/itzcodex24/git-guardian.git
cd git-guardian
  1. Build the CLI tool:
go build -o guardian ./...
  1. Move it to your PATH for global access:
sudo mv guardian /usr/local/bin/

⚡ Usage

Initialize Guardian in a folder:

guardian init

Link a folder to Guardian:

guardian link ~/Projects/myproject

Start automatic backup:

  • Watch mode (on change):
guardian start ~/Projects/myproject --watch --debounce 30s
  • Interval mode (every 5 minutes):
guardian start ~/Projects/myproject --interval 5m

Manage watchers:

guardian listeners          # List active watchers
guardian pause <id>         # Pause a watcher
guardian resume <id>        # Resume a watcher
guardian remove <id>        # Remove a watcher

Autostart Guardian on Mac login:

guardian autostart enable
guardian autostart disable

📝 Collaboration Guidelines

Git 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:

  1. Fork the repository and create a feature branch:
git checkout -b feature/my-awesome-feature
  1. Write code and tests for your feature.
  2. Commit changes with clear messages:
git commit -m "Add feature X with Y improvements"
  1. Push to your fork and open a pull request.
  2. Code review: PRs will be reviewed, and feedback may be requested before merging.
  3. 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

About

Git Guardian - A CLI tool used to help you run Git backups automatically without any hassle.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages