How can I export all the modified files in a .zip. I need it to be between a range of commits for example between the initial commit and the head. I found some codes and I've tried a lot but it really does not work for me. I leave an example of the codes that have not worked for me.
git archive -o export.zip HEAD $(git diff --name-only commit1..commit2)
git diff --name-only commit1..commit2 | git archive -o export.zip HEAD