6

I would like to have an git log (or in any other way) output like this,

2015-01-14 10:33:14 main.cpp
2014-10-30 11:30:22 some.cpp
2014-10-27 10:15:43 another.cpp
2014-10-27 09:41:22 main.cpp
2014-10-24 19:15:08 some.cpp

Basically the output should contain date, time and the file changed. And one entry should be in one line as example shows. I have checked pretty formats, but could not find a way to output the file names.

So, how to get something like this from git commands?

Morpheus
  • 1,722
  • 5
  • 27
  • 38
  • Now before posting - I know you looked at this http://git-scm.com/docs/git-log correct? – Nefariis Oct 01 '15 at 17:54
  • @Nefarii, yes I spent lot of time with different options in there :( I was able to get list of changed file in one instance and timestamps in another instance, but could not get both – Morpheus Oct 01 '15 at 17:56

2 Answers2

8

This is what awk's for.

git log --pretty=%x0a%ci --name-only \
| awk '
     /^$/        { dateline=!dateline; next }
     dateline    { date=$0; next }
     !seen[$0]++ { print date,$0 }
'
jthill
  • 55,082
  • 5
  • 77
  • 137
0

I think what you are looking for is

git diff --name-only

that will get you changed filenames since your last commit

You can do

git diff --name-only <commit1> <commit2>

to get changed files between two commits

Grisha
  • 426
  • 5
  • 9