nishtman / repo-backup
A production-ready Laravel package for backing up Git repositories via Artisan commands and schedules.
0.1.0
2026-07-21 11:32 UTC
Requires
- php: ^8.2
- illuminate/cache: ^11.0 || ^12.0 || ^13.0
- illuminate/config: ^11.0 || ^12.0 || ^13.0
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/container: ^11.0 || ^12.0 || ^13.0
- illuminate/database: ^11.0 || ^12.0 || ^13.0
- illuminate/events: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- laravel/prompts: ^0.3
- symfony/process: ^7.0 || ^8.0 || ^9.0
Requires (Dev)
- orchestra/testbench: ^9.0 || ^10.0
- phpunit/phpunit: ^10.5 || ^11.0
This package is auto-updated.
Last update: 2026-07-21 15:10:00 UTC
README
A production-ready Laravel package for automatically backing up Git repositories through Artisan commands, Laravel scheduling, and rich CLI UX.
Features
- Manage repositories with interactive Artisan commands
- Validate Git remotes and destination paths before saving
- Clone, fetch, checkout, and pull repositories using Symfony Process
- Record backup history with timings, exit codes, and output
- Prevent concurrent backups with Laravel cache locks
- Export and import repository configurations as JSON
- Diagnose package health with
repo-backup:doctor
Installation
composer require nishtman/repo-backup
Publishing configuration
php artisan vendor:publish --tag=repo-backup-config php artisan vendor:publish --tag=repo-backup-migrations
Running migrations
php artisan migrate
Artisan commands
php artisan repo-backup:addphp artisan repo-backup:listphp artisan repo-backup:remove {id}php artisan repo-backup:historyphp artisan repo-backup:backupphp artisan repo-backup:schedulephp artisan repo-backup:doctorphp artisan repo-backup:testphp artisan repo-backup:exportphp artisan repo-backup:import --file=path/to/file.jsonphp artisan repo-backup:sync
Scheduling
use Illuminate\Support\Facades\Schedule; use Nishtman\RepoBackup\RepoBackup; Schedule::command('repo-backup:backup')->daily(); RepoBackup::schedule();
Import and export
php artisan repo-backup:export --file=repo-backups.json php artisan repo-backup:import --file=repo-backups.json
FAQ
Does the package require a Laravel app?
Yes, it is designed for Laravel applications and packages.
Can I run backups manually?
Yes, use php artisan repo-backup:backup or php artisan repo-backup:sync.
Contributing
Contributions are welcome. Please open an issue or submit a pull request.