How to export files from git repository without change history?

Often, as a product to the customer, not only binary files are transferred, but also source codes of applications.
It is then worth considering whether you want to transfer the entire GIT repository or only the source codes.

If we were the recipient of a product, the history of file changes can be very valuable information. With the history, we can read the context of the changes - what files were changed within a single commit and read a description of the commits.

On the other hand, if our commit descriptions are of poor quality or the repository contains, for example, development branches for future versions, we may not want to transfer the entire GIT repository.

GIT has a command that allows you to export files without their history to a ZIP archive.
The important thing is to indicate from what point the files will be exported. It is best to specify a point that does not change, such as a specific commit ID or tag. We can also specify the branch name, but then make sure that we have downloaded the latest changes, e.g. for the branch master we can use the command git checkout master && git pull.

Example of source code export from tag v2.0.13 to project.zip file

1git archive --format zip --output project.zip v2.0.13

Translations: