Skip to content

Instantly share code, notes, and snippets.

@prasidhda
Last active June 11, 2020 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasidhda/cdedfea96c15c51d0147b0488219e2ed to your computer and use it in GitHub Desktop.
Save prasidhda/cdedfea96c15c51d0147b0488219e2ed to your computer and use it in GitHub Desktop.
If you're trying to zip up a project which is stored in Git, use the git archive command. From within the source directory:
git archive -o bitvolution.zip HEAD
You can use any commit or tag ID instead of HEAD to archive the project at a certain point.
If you want to add a prefix (e.g., a top level folder) to every file:
git archive -o bitvolution.zip --prefix=bitvolution/ HEAD
You can also adjust the compression level between 0 (no compression) and 9 (maximum compression) inclusive, for example
git archive -o bitvolution.zip -9 HEAD
For other options, see the help page (git help archive).
If you're trying to zip up a project which is stored in Git, use the git archive command. From within the source directory:
git archive -o bitvolution.zip HEAD
You can use any commit or tag ID instead of HEAD to archive the project at a certain point.
If you want to add a prefix (e.g., a top level folder) to every file:
git archive -o bitvolution.zip --prefix=bitvolution/ HEAD
You can also adjust the compression level between 0 (no compression) and 9 (maximum compression) inclusive, for example
git archive -o bitvolution.zip -9 HEAD
For other options, see the help page (git help archive).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment