1. Go to this page and download the library: Download bazo/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/ */
bazo / git-wrapper example snippets
use GitWrapper\GitWrapper;
// Initialize the library. If the path to the Git binary is not passed as
// the first argument when instantiating GitWrapper, it is auto-discovered.
clone a repo into `./path/to/working/copy`.
$git = $wrapper->workingCopy('./path/to/working/copy');
$git->clone('git://github.com/cpliakas/git-wrapper.git');
// Create a file in the working copy.
touch('./path/to/working/copy/text.txt');
// Add it, commit it, and push the change.
$git
->add('test.txt')
->commit('Added the test.txt file as per the examples.')
->push();
// Render the output.
print $git->getOutput();
// Execute an arbitrary git command.
// The following is synonymous with `git config -l`
print $wrapper->git('config -l');