Skip to content

Instantly share code, notes, and snippets.

View alexford's full-sized avatar
:shipit:
Shipping it

Alex Ford alexford

:shipit:
Shipping it
View GitHub Profile
@alexford
alexford / index.php
Created December 11, 2012 20:54
Quick way to include Git branch/commit info on PHP page
<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")?>