Skip to content

Instantly share code, notes, and snippets.

@geeknam
geeknam / git_history.php
Created May 8, 2011 16:43
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log",$output);
$history = array();
foreach($output as $line){
if(strpos($line, 'commit')===0){