Bash script to iterate all commits of a given Git repository and extract all files within each commit.
With a Git repository at /path/to/repository
and an empty directory at /path/to/output
we can run:
./export.sh /path/to/repository /path/to/output
Export 1d9048853b8073e43e43e3250300a82f93d2f431 -> /path/to/output/1d9048853b8073e43e43e3250300a82f93d2f431