Faced a problem, I use the Grunt project broker, when I send to a remote repository I want to ignore the folder

node_modules , but constantly knocks an error. I try:

 node_modules/ .gitignore node_modules/* .gitignore 

Tell me, please, how to properly use in this case .gitignore , because There are a lot of other folders in this folder and all of them need to be ignored.

  • five
    At the root of the project with git create a file .gitignore in which you register node_modules/ .... all - Alexey Shimansky
  • 3
    Tell me, where did the idea to add .gitignore to the end of the line? - Pavel Mayorov

1 answer 1

Create a text file named .gitignore in the project root and enter directory names (in your particular case - only one - node_modules ) that you want to ignore, one per line.

make sure that your editor in this file uses the \n ( lf , linefeed ) symbol , but not \r ( cr , carriage return ), and not their combination \r\n ( crlf ) as the line feed .


useful information: