Skip to content

Instantly share code, notes, and snippets.

@kennyp
Created February 26, 2013 20:30
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kennyp/5041881 to your computer and use it in GitHub Desktop.
Save kennyp/5041881 to your computer and use it in GitHub Desktop.
If you need to sort files by creation date in git. ex. `find . -name '*.rake' | git by-date`
#!/usr/bin/bash
while read f
do
echo "$(git log --format="%at" --reverse "$f" | head -n1) --> $f"
done | sort -n
@Riveascore
Copy link

Beautiful!

@inglesp
Copy link

inglesp commented Aug 4, 2021

Thank you @kennyp!

@ahmetb
Copy link

ahmetb commented Oct 18, 2021

fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment