PHP code example of stikman / php-git-version-tool
1. Go to this page and download the library: Download stikman/php-git-version-tool 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/ */
stikman / php-git-version-tool example snippets
function getVersion($path, $remoteUrl, $version = 'master') {
$git = new GitWrapper();
$git->cloneRemoteNoCheckout($path, $remoteUrl);
if($version !== 'master ) {
$ref = $git->getTagRef($path, $version);
}
$git->checkoutRef($path, $ref);
}