问题出现
拉取的项目,在npm i之后左侧的源代码管理器出现了5k+的更改文件甚至更多无法显示,如下图所示。
问题原因
没有使用git忽略文件脚本
解决办法
在项目中与src同级别的目录下,添加.gitignore文件(注意前面有个点)
文件内容如下图所示:
实现效果
如下图:
附.gitignore文件常用配置
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln