DEV Community


Discussion on: Stop tracking and start ignoring

tmaila profile image
Tomi Maila

You should not ignore package.json, it is a key file shared between all the developers defining package dependencies. You should ignore build artefacts and installed dependencies and user specific configuration files such as IDE configuration, that is specific to a single user. Note that some IDE config files you don't want to ignore such as build configurations because they're the same for the whole team.

matteojoliveau profile image
Matteo Joliveau

True. Also Gemfile and Gemfile.lock should be included for the same reason.

svijaykoushik profile image
Vijay Koushik, S. 👨🏽‍💻 Author

Wow! Thank you so much for your valuable comments everyone. But, in my defense I want to make it clear why I talked about deleting package.json and Gemfile.lock files.

  1. I said I deleted the package.json file because, The project was my personal static website hosted on GitHub pages. I used gulp as a dev dependency and to me it was never needed to be on the repo since I use a single machine for development.
  2. I talked about me deleting the Gemfile.lock file because, my blog is also hosted on GitHub pages and is rendered with Jekyll. So, I do not know the consequences of keeping the file in the repo which is deployed in an environment which I don't have control of.

Thank you all again for pointing out the importance of package.json, package-lock.josn, Gemfile and Gemfile.lock files being in the repo 🙂

writecodeeveryday profile image
Lazaro Herrera

This is true.

package.json should exist in case one of your dependencies in package-lock.json is platform specific and package.json is used for finding a compatible version.