I need to get the Date and commit results of a set of github in this format:
Date Commit
19 Mar 2015 b6959eafe0df6031485509c539e22eaf2780919c
1 Apr 2015 9a
How about:
git log | awk '/^commit / { commit = $2 }
/^Date: / { printf "%s %s %s %s\n", $4, $3, $6, commit }'
Capture the commit information in the variable commit. When a date comes along, print the date and commit information.
It is often a bad idea to pipe the output of grep to awk; awk is perfectly capable of doing the filtering that grep does.