In brief
git archive creates an archive from a specified Git tree or revision. It differs from packaging the entire working directory with untracked and edited files.
Useful to know
git archive creates an archive from a specified Git tree or revision. It differs from packaging the entire working directory with untracked and edited files. [1]
Select the exact release commit and handle additional required data separately. Configuration outside Git and uploaded user files do not magically appear in a historical tree. A code archive is not necessarily a complete backup of a running site.
Sources
For further detail and to check the information: