Skip to content

Instantly share code, notes, and snippets.

@afeish
Forked from simonw/how-to.md
Last active September 21, 2020 05:56
Show Gist options
  • Save afeish/60b4151613ee71d2ebbfd437b88b1280 to your computer and use it in GitHub Desktop.
Save afeish/60b4151613ee71d2ebbfd437b88b1280 to your computer and use it in GitHub Desktop.
How to create a tarball of a git repository using "git archive"
# archive the entire repo
git archive --format=tar.gz -o fastone-upgrade-guide.tar.gz --prefix=fastone-upgrade-guide/ master
# archive the given directory[upgrade] of the repo
git archive --format=tar.gz -o fastone-upgrade-guide.tar.gz --prefix=fastone-upgrade-guide/ HEAD:upgrade/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment