Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Node.JS-specific files and folders are usually excluded via .gitignore?

Tags:

git

node.js

I'm a newbie Node.JS developer...

What do developers usually exclude from their Node.JS git repositories in production via .gitignore?

node_modules? bin? Etc...

like image 807
Aaronontheweb Avatar asked Dec 15 '11 04:12

Aaronontheweb


People also ask

What files should be in Gitignore?

gitignore should contain all files that you want to ignore. Therefore, you should ignore files generated by the OS, the IDE you are working on... My question appears when the repository is on Github and people can clone it and push the changes. These people can use other operating systems and can use other IDEs.

Can Gitignore ignore folders?

gitignore is a plain text file in which each line contains a pattern for files or directories to ignore. It uses globbing patterns to match filenames with wildcard characters. If you have files or directories containing a wildcard pattern, you can use a single backslash ( \ ) to escape the character.

Which file stores the files/folders to be ignored by Git?

The . gitignore file tells Git which files to ignore when committing your project to the GitHub repository. gitignore is located in the root directory of your repo.

Why files in Gitignore are not ignored?

gitignore ignores only untracked files. Your files are marked as modified - meaning they were committed in the past, and git now tracks them. To ignore them, you first need to delete them, git rm them, commit and then ignore them.


1 Answers

GitHub has created a repository to answer this kind of questions for several languages/frameworks, including one for NodeJS.

https://github.com/github/gitignore/blob/master/Node.gitignore

Here is the current one for reference :

lib-cov *.seed *.log *.csv *.dat *.out *.pid *.gz  pids logs results build  node_modules 
like image 126
seppo0010 Avatar answered Sep 30 '22 17:09

seppo0010