Created
February 12, 2013 09:47
-
-
Save jbrooksuk/4761242 to your computer and use it in GitHub Desktop.
PHP Working Git Branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_gitHead = file('.git/HEAD', FILE_USE_INCLUDE_PATH); | |
$_gitHead = $_gitHead[0]; | |
$_gitString = explode("/", $_gitHead); | |
$_gitBranchName = trim($_gitString[2]); | |
printf("<h4>Working Git Branch:</h4> <strong>» %s</strong>", $_gitBranchName); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment