Git Syntax: How to archive a repository?

Any one of the following will work:

git archive --output=../_toDeploy/ArchiveName.zip master
git archive -o ../_toDeploy/ArchiveName.zip master

To add a subdirectory inside the archive,

git archive --output=../_toDeploy/ArchiveName.zip --prefix=MyStuff/ master

See the git-archive manual page for reference.


The following will zip up your master branch and put it in the folder you mentioned.

git archive --format=zip master > ../_toDeploy/repo.zip