0

I have a repo I just checked out. It's basically a group of folders where each folder is an example illustrating a technique developing on a specific platform.

However, some of the samples are wildly out of date.

Given a location in a repo is there a way to show the last commit date for each item (file or folder) in the location? So if I have repo foo containing folders bar and bar2 I want to see the last commit date for bar and bar2 taking into account everything under them, but I don't want to list everything under them.

2
  • possible duplicate of How to get the last commit date for a bunch of files in git? Commented Apr 17, 2014 at 21:34
  • I suppose it would be a dupe if I thought git log could just give me the top level folder/files that I resided in, but I'm not sure I'm aware of a way. The answer in what you're marking as a dupe does a file filter, which is not what I want. I'd accept an answer using git log that does what I want though. Commented Apr 17, 2014 at 21:56

1 Answer 1

1

You can get list of files/directories in particular location using find and then run git log -n1 on each of the items. Something like this will print out last commit's hash and date for each file/directory in ./foo:

find ./foo -maxdepth 1 -print0 | xargs -t -n 1 -0 git log -n 1 --pretty=tformat:"%h %ci" | cat 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.