Jump to content
Ciwan

Node and Gulp. What should I check into Git?

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • By Fuzzy Logic
      I'm trying to get gulp to work but no matter what I do it just won't
      var gulp = require('gulp'); var browserSync = require('browser-sync').create(); var sass = require('gulp-sass'); // Compile sass into CSS & auto-inject into browsers gulp.task('sass', function() { return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss']) .pipe(sass()) .pipe(gulp.dest("src/css")) .pipe(browserSync.stream()); }); // Move the javascript files into our /src/js folder gulp.task('js', function() { return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/tether/dist/js/tether.min.js']) .pipe(gulp.dest("src/js")) .pipe(browserSync.stream()); }); // Static Server + watching scss/html files gulp.task('serve', ['sass'], function() { browserSync.init({ server: "./src" }); gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], ['sass']); gulp.watch("src/*.html").on('change', browserSync.reload); }); gulp.task('default', ['js','serve']); This is the error
       
    • By Pascal AOMS
      Heyhey,
       
      I looked into Grunt/Gulp and their automations like minifying, concatenation, image optimization, live reload and error hinting.
       
      It all works fine but why setting up all this and maybe having a stressful use with the command line if you can just use an app like Prepros or CodeKit?
       
      I understand that Task Managers can also stuff like creating folders, copy/remove files and a bit more but I don't need this in my personal workflow.
       
      Can anyone explain to me why I should still use a Task Manger Script or is it really just a matter of taste in the end?
    • By Hainzee
      Hi everybody, I just want to ask if there are any Node developers here who are happy to leave some details. I am thinking of posting some projects here in the future. Your details won't be shared without permission!
    • By Acknowledged74
      Hi
       
      I've been asked to use GIT code version control, which frankly I don't know about. I'm presuming you put code in and it makes sure its say HTML 5?
       
      Also we will be using Expression Engine to build the site, how would the 2 things intergrate would you think?
       
      Really appreciate some advice, my boss expects, and we all kow how that feel :0)
       
      Ta.
    • By evu
      Hi,
       
      I've had a little experience with Git on a personal level, mainly to get to grips with it. In this case I had a local WP installation set up on ampps, I'd make changes and when I was happy I'd push the changes to Bitbucket and FTPloy would deploy them to my live server. No problem, simple enough.
       
      Now, the question is, how does this work for a large ecommerce site? At work we have a dev server and the live server. At the momement, we simply use FTP to try things on the Dev server and when it's signed off, it just gets manually FTP'd to the live server. What I'm confused about is how do you try things if I don't have a local server set up?
       
      I had planned on getting it set up so that things are pushed to the dev server, once it's signed off it gets merged with the live server code base and pushed to the live server. I don't understand how this works though, do I have to push/commit everything I want to try whilst developing to the dev server? That's a lot of hassle...
       
      How do you manage such a use case?
  • Recently Browsing

    No registered users viewing this page.

  • Member Statistics

    • Total Members
      57,712
    • Most Online
      4,970

    Newest Member
    adabo
    Joined
  • Forum Statistics

    • Total Topics
      65,781
    • Total Posts
      454,596
×