Interview Prep/Git & GitHub/Commits, branches and tags

What is `git archive` and why use it instead of zipping the folder?

IntermediateConceptCommits, branches and tags
Answer

<details> <summary><b>Answer</b></summary>

It exports a tree at any revision as tar or zip without the .git directory, honouring export-ignore and export-subst attributes. It is reproducible and uses committed content only, so no stray local files leak into a release tarball.

git archive --format=tar.gz --prefix=app-1.4.0/ -o app-1.4.0.tar.gz v1.4.0
All Git & GitHub questions Roadmap: Git & GitHub

More on Commits, branches and tags