Skip to content

Instantly share code, notes, and snippets.

View jankal's full-sized avatar
🏡
Working from home.

Alexander Jank jankal

🏡
Working from home.
View GitHub Profile
@jankal
jankal / git_history.php
Last active March 20, 2016 12:24 — forked from geeknam/git_history.php
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($lines as $key => $line) {
if(strpos($line, 'commit') === 0 || $key + 1 == count($lines)){