git-archive
Create an archive of files from a tree. tldr-pages
On several platforms
Several platforms
Create a .tar archive from the contents of the current HEAD and print it to stdout
git archive --verbose HEADIdentifyUse the Zip format and report progress verbosely
git archive --verbose --format zip HEADIdentifyOutput the Zip archive to a specific file
git archive --verbose --output path/to/file.zip HEADIdentifyCreate a .tar archive from the contents of the latest commit of a specific branch
git archive --output path/to/file.tar branch_nameIdentifyUse the contents of a specific directory
git archive --output path/to/file.tar HEAD:path/to/directoryIdentifyPrepend a path to each file to archive it inside a specific directory
git archive --output path/to/file.tar --prefix path/to/prepend/ HEADIdentify