Jump to content


Photo

Node and Gulp. What should I check into Git?

node git gulp

  • Please log in to reply
5 replies to this topic

#1 Ciwan

Ciwan

    Advanced Member

  • Members
  • PipPipPip
  • 419 posts
  • Location:UK
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 06 October 2015 - 09:08 AM

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.



#2 Wynn

Wynn

    Dedicated Member

  • Members
  • PipPip
  • 220 posts
  • Gender:Male
  • Location:UK
  • Experience:Nothing
  • Area of Expertise:Coder

Posted 06 October 2015 - 10:43 AM

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.



#3 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,666 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 06 October 2015 - 10:45 AM

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 by rbrtsmith, 06 October 2015 - 10:46 AM.


#4 Ciwan

Ciwan

    Advanced Member

  • Members
  • PipPipPip
  • 419 posts
  • Location:UK
  • Experience:Beginner
  • Area of Expertise:I'm Learning

Posted 06 October 2015 - 10:59 AM

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 by Ciwan, 06 October 2015 - 11:00 AM.


#5 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 2,929 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 06 October 2015 - 11:04 AM

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.



#6 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,666 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 10 October 2015 - 08:49 AM

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.







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users