October 6, 201511 yr Hello Friends I am just starting out with NodeJS and Gulp. I have everything working as I want, and I now want to keep track of my changes via Git. What are the files and folder that I should add to `.gitignore`? Attached is the folders I have. Inside public I have two folders. These are `src` and `dist`. Any help would be greatly appreciated. Thank you.
October 6, 201511 yr Take a look at https://www.gitignore.io you can use it online or through the Command Line. Just type in every tool, operating system etc. you might use and it'll generate a .gitignore file for you.
October 6, 201511 yr I generally just add node_modules folder to my .gitignore and any other dependencies that can be featched in a similar way to how node works with the package.json Some people ignore their source files too, but I choose to keep mine in the repository. Of course there's more stuff to add if you are using a CMS such as a user uploads folder, security configs etc. Edited October 6, 201511 yr by rbrtsmith
October 6, 201511 yr Author Is it a matter of adding everything that cannot be generated? If that is the case, then I need to exclude: node_modules public/dist Everything else I need, since those won't be generated. On a related note, say someone checks out my solution at a different computer. How would they get node to go through the `package.json` and download all necessary modules? What command should he/she run? Thanks Edited October 6, 201511 yr by Ciwan
October 6, 201511 yr Is it a matter of adding everything that cannot be generated? If that is the case, then I need to exclude: node_modules public/dist Everything else I need, since those won't be generated. On a related note, say someone checks out my solution at a different computer. How would they get node to go through the `package.json` and download all necessary modules? What command should he/she run? Thanks Running npm install will download the dependancies if you have a package.json file in the directory.
October 10, 201511 yr Is it a matter of adding everything that cannot be generated? If that is the case, then I need to exclude: node_modules public/dist Everything else I need, since those won't be generated. On a related note, say someone checks out my solution at a different computer. How would they get node to go through the `package.json` and download all necessary modules? What command should he/she run? Thanks Not always. When I release something for public use I also publish the dist folder as not everybody who is using it will have NPM or Node or even Gulp on their machine.
Create an account or sign in to comment