Git - Ignore node_modules folder everywhere

后端 未结 11 884

I have a project containing multiple other projects :

  • Main project
    • Mini project 1
    • Mini project 2

All containing <

11条回答
  •  爱一瞬间的悲伤
    2020-11-28 01:02

    First and foremost thing is to add .gitignore file in my-app. Like so in image below.

    and next add this in your .gitignore file

    /node_modules
    

    Note

    You can also add others files too to ignore them to be pushed on github. Here are some more files kept in .gitignore. You can add them according to your requirement. # is just a way to comment in .gitignore file.

    # See https://help.github.com/ignore-files/ for more about ignoring files.
    
    # dependencies
    /node_modules
    
    # testing
    /coverage
    
    # production
    /build
    
    # misc
    .DS_Store
    .env.local
    .env.development.local
    .env.test.local
    .env.production.local
    
    npm-debug.log*
    yarn-debug.log*
    yarn-error.log*
    

提交回复
热议问题