Skip to content

Instantly share code, notes, and snippets.

@raj-uimatic
Created November 8, 2017 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raj-uimatic/5c347f154856f8e197014d64f622dee7 to your computer and use it in GitHub Desktop.
Save raj-uimatic/5c347f154856f8e197014d64f622dee7 to your computer and use it in GitHub Desktop.
git head data for php site
<?php
$head = exec("git log -1 --pretty=format:'%h - (%ci)' --abbrev-commit");
$msg = exec("git log -1 --pretty=format:'%s ' --abbrev-commit");
echo "$head - $msg";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment