Export a Snapshot With git archive
Produce a release tarball of tracked files at a commit or tag.
Run git archive --format=zip HEAD -o project.zip to export the current tree.
01Command
Command
$ git archive --format=zip HEAD -o project.zip02What it does
archive writes only tracked content and can prefix a top-level directory with --prefix, making reproducible source tarballs for releases or deployment. It is scriptable in CI where a GUI export dialog would not be.
03Risk
!Warning: Untracked and ignored files are excluded by design; use a different tool if you need build artifacts.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- git-archive documentationEvidence: Documents git archive, which exports a tree to a tar or zip archive.
Last verified: 2026-10-13 · Category: Developer