Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

GitHub .gitignore recommendation

which folders/files should be excluded in .gitignore file?

I’m creating a project consists of:

  1. /node_modules => contains dependencies
  2. /dist => contains the compiled .js & .d.ts files
  3. /src => contains .ts files (the main project)
  4. /test => contains .js & .ts just for testing

I usually exludes the /node_modules & /test but not sure to exclude the /src.
Any idea?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should ignore any file that is generated. If I download your project, I can use package.json to generate node_modules, so ignore node_modules.

But if I download your project and it doesn’t have src will I still be able to generate src? Most likely not, as this is probably code you have written so put it up.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading