Skip to content

Instantly share code, notes, and snippets.

@fritz0705
Last active December 13, 2015 17:28
Show Gist options
  • Save fritz0705/4948270 to your computer and use it in GitHub Desktop.
Save fritz0705/4948270 to your computer and use it in GitHub Desktop.
<?php
function get_head_commit($dir = "./") {
$head = explode(": ", file_get_contents($dir . "/HEAD"));
assert($head[0] == "ref");
$head = $head[1];
$head = file_get_contents($dir . "/" . $head);
return $head;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment