Created
October 22, 2019 10:30
-
-
Save allyjweir/1e6df07e3a50135943d0998f62bfe7db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Lists files in directory with date added and SHA of commit in which they were | |
# added. | |
# | |
# Handy for: | |
# - Figuring out order of DB migrations | |
# - ??? | |
# | |
# Adapted from: https://stackoverflow.com/questions/10975563/how-can-i-see-the-date-multiple-files-were-created-on-git | |
for file in $(git ls-files) | |
do | |
HASH=$(git rev-list HEAD "$file" | tail -n 1) | |
DATE=$(git show -s --format="%ci" $HASH --) | |
printf "%-25s | %-30s | %-100s\n" "$DATE" $HASH "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment