Studyon Minte9.com
Git




Get branch in php




<?php $file = __DIR__ . '/../.git/HEAD'; // $file = dirname(__FILE__) . '/../.git/HEAD'; if(file_exists($file)) { $fd = file($file, FILE_USE_INCLUDE_PATH); $tmp = explode("/", $fd[0]); $branch = trim($tmp[2]); }