Answer the question
In order to leave comments, you need to log in
How to add only the contents of a folder to Git repositories?
Hello. I have something like this project structure:
there is a build folder, and in it all the files: scripts, styles, html, etc. This is the working folder. It is located in the main project folder along with other files: gulpfile.js, /node_modules, package.json, etc.
Actually the question: I only need to add the contents of the build folder to the repository, but I cannot create repositories in it, since my gulp updates the contents of this folder by deleting it. The git repository must be in the root folder. But how then to add only the contents of the build folder, without the folder itself?
Answer the question
In order to leave comments, you need to log in
Your approach to VCS is actually kind of strange. It is necessary to track just the source codes and the files themselves that describe the builds. And the build folder - the first line goes to .gitignore, immediately after it - node_modules and other folders that are pumped out by package managers (be it bower, npm, composer or whatever).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question