Reputation: 1959
git archive --format zip -- output ~/Desktop/file.zip master
This is how I export my git project, it will not export file or folder which in .gitignore file, but if it's possible to export a specific file or folder like
git archive --format zip --include vendor/ -- output ~/Desktop/file.zip master
Upvotes: 0
Views: 990
Reputation: 1161
In order to do this, you must first mark the folders or files you don't want to put into the archive with export-ignore
in the repo's .gitattributes
:
/src export-ignore
/build export-ignore
/test export-ignore
/.git* export-ignore
Then you can call git archive
with --worktree-attributes
to ignore the specified files.
See: git archive
Upvotes: 1