git上傳忽略node_modules目錄


在項目的根目錄,右鍵選擇 Git Bash 進入命令行;

在命令行輸入:

touch .gitignore

生成 .gitignore 文件;

在文件中輸入過濾信息,過濾規則如下:

node_modules/   表示過濾這個文件夾
*.zip   過濾zip后綴文件
demo.html   過濾該文件

我的項目中配置的是:

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# 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*


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM