PHP code example of aaronidikko / laravel-git-sync

1. Go to this page and download the library: Download aaronidikko/laravel-git-sync library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aaronidikko / laravel-git-sync example snippets


return [
    // Default prefix for auto-generated commit messages
    'default_commit_prefix' => env('GIT_SYNC_COMMIT_PREFIX', 'chore'),

    // Timestamp format for commit messages
    'timestamp_format' => env('GIT_SYNC_TIMESTAMP_FORMAT', 'Y-m-d H:i'),

    // Default remote repository
    'default_remote' => env('GIT_SYNC_REMOTE', 'origin'),

    // Safety checks
    'safety_checks' => [
        'max_file_size' => 10, // MB
        'protected_branches' => ['main', 'master', 'production'],
    ],
];
bash
php artisan git:sync:install
bash
php artisan vendor:publish --tag=git-sync-config
bash
# Default chore message
php artisan git:sync

# With custom message
php artisan git:sync -m "Add new feature"
php artisan git:sync --message="Fix bug"

# Other options
php artisan git:sync --verbose
php artisan git:sync --commit-only
php artisan git:sync --pull
php artisan git:sync --dry-run
bash
php artisan git:sync:install
json
"scripts": {
    "sync": "@php artisan git:sync"
}
bash
php artisan git:sync -m "Add new feature"
php artisan git:sync --commit-only
php artisan git:sync --pull
php artisan git:sync --dry-run
php artisan git:sync --branch=develop
bash
php artisan git:sync:install