Zipping all relevant files in a git repo

This will skip all the unnecessary stuff, like .git directory, and files ignored in the git repo itself:

git archive --format=zip -o archive-name.zip HEAD

You can omit --format.zip when you specify output files via -o, the format will be inferred.
Add --prefix subdir-name to have all files in the archive be put into a folder inside the archive, e.g:

git archive --prefix subdir-name/ -o archive-name.zip HEAD

Avatar
Dmitry Avtonomov
Research Fellow

My main research interests are data visualization and processing for mass spectrometry.

Related