1. Go to this page and download the library: Download sebastianfeldmann/git 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/ */
sebastianfeldmann / git example snippets
$repoRootPath = '/var/www/my-project';
$gitRepository = new Git\Repository($repoRootPath);
use SebastianFeldmann\Git;
out .git
$repoRootPath = '/path/to/repo';
$gitRepository = new Git\Repository($repoRootPath);
// get files and commits since hash or tag
$log = $gitRepository->getLogOperator();
$files = $log->getChangedFilesSince('1.0.0');
$commits = $log->getCommitsSince('1.0.0');
// check the index status
$index = $gitRepository->getIndexOperator();
$files = $index->getStagedFiles();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.