You have a directory of files in a git repository and you want to extract their original creation dates. Git does not track file creation date metadata, but you can get the first time the file was added in a commit.
This one-liner will print the dates and filenames sorted, in column format.
# One-liner
WIDTH=35 ; for filename in * ; do created_date=$(git log --follow --format=%ad --date default $filename | tail -1); printf "%-${WIDTH}s | %s \n" "$created_date" $filename ; done | sort
# More readable multi-line
WIDTH=35 # Column padding width
DIR=. # You can substitute this for a directory name
for filename in "${DIR}"/*
do
created_date="$(git log --follow --format=%ad --date default $filename | tail -1)"
printf "%-${WIDTH}s | %s \n" "$created_date" $filename
done | sort
credit for enhancements to @datYori
credit for original inspiration to Timothy Keith - https://keithieopia.com/post/2017-03-09-git-file-creation-date/.
Credit to Timothy Keith for the Git date function. Sorting and columns added.