Export git subfolder to archive

Today a colleague of mine wanted to export a single folder from a git repository to a tar.gz archive. This is how to export git subfolder to archive:

With this snippet the git repository folder path/to/file/or/folder/in/repo is exported to the archive file archived_folder.tar.gz. The archive will be cleared of all git information (no .git* files).

Further information about export git subfolder:

 

One thought on “Export git subfolder to archive

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.