1. Go to this page and download the library: Download leapt/git-wrapper 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/ */
leapt / git-wrapper example snippets
use Leapt\GitWrapper\Repository;
$repository = new Repository('/path/to/the/git/repo');
// change current branch to main
$repository->git('checkout main');
// pull from a remote
$repository->git('pull origin main');
// add a remote repo
$repository->git('remote add origin https://github.com/leapt/git-wrapper.git');
echo $repository->git('log --oneline');
$repository->git('unknown'); // this git command does NOT exist: throw GitRuntimeException
$repository = new Repository('/path/to/the/git/repo', true);
$repo = new Repository('/path/to/the/git/repo', false, ['git_executable' => '/usr/bin/git']);
use Leapt\GitWrapper\Repository;
$repository = new Repository('/path/to/the/git/repo', false, ['command_class' => YourCommand::class]);
bash
composer install --working-dir=tools/php-cs-fixer
# Check what can be fixed
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff
# Fix them
tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --diff
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.