Sort files in a directory by modification time in Git
Recently, I had a sort of unusual requirement to get the last modified file (tracked by git
) in a certain directory for a specific branch. I tried to look for any existing porcelain or plumbing command in git
that can be used to advantage, but couldn't find anything, so had to stitch up something combining several utilities.
Here's how it looks eventually: