When I run this command, the files of my latest commit are saved to a ZIP.
git archive -o ../code_version0.9.zip HEAD
However the files in node_modules
and build/
are missing.
That Is because my .gitignore
is the following one:
node_modules
build/
How can I ignore files, but Include them In the archive?
I looked into the documentation for .gitattributes
but I couldn't find a include statement.
As far as my knowledge goes,
git archive
only archives files tracked by git, and.gitignore
only ignores untracked files. Hence you will never manage togit archive
files that are in your.gitignore
. Or what am I missing?