To export all revisions of a file to a given folder, you can use this loop in Bash:
for sha in `git rev-list HEAD -- path/to/file`; do
git show ${sha}:path/to/file > path/to/exportfolder/${sha}_doc.ai
done
You can customize this, of course.
Copy the snippet into a text file, and replace path/to/file
with the actual path to the file you want to export (inside the repo). Replace path/to/exportfolder
with the actual path to where you want to export the files to (the export folder must exist). You can also modify the exported filename, in this version it uses the format "_doc.ai"; just make sure to use quotes if you want to use a file or path name with spaces.
This version will start at the currently checked out revision (HEAD
) and walk over the history to all revisions reachable from HEAD
in the ancestry tree. That means you should check out the most recent revision you want to start exporting from.