Created
December 11, 2012 20:54
-
-
Save alexford/4262041 to your computer and use it in GitHub Desktop.
Quick way to include Git branch/commit info on PHP page
This file contains hidden or 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
<strong>Branch: </strong><?=shell_exec('git rev-parse --abbrev-ref HEAD')?><br/> | |
<strong>Commit: </strong><?=shell_exec("git log -1 --pretty=format:'%h - %s (%cn, %cr)' --abbrev-commit")?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output
Branch: development
Commit: 83f7383 - Better instance info in footer (shows branch and last commit) (alexford, 3 minutes ago)