A
A
afishr2015-10-17 17:06:28
git
afishr, 2015-10-17 17:06:28

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

2 answer(s)
I
Igor Vorotnev, 2015-10-17
@afishr

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).

C
Curly Brace, 2015-10-17
@stasuss

gitignore to use for everything around?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question