Skip to content

Instantly share code, notes, and snippets.

@geeknam
geeknam / git_history.php
Created May 8, 2011
Parse git log with PHP to an array
View git_history.php
<?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){