美文网首页
git .ignore忽略文件夹中除了指定的文件外的其他所有文件

git .ignore忽略文件夹中除了指定的文件外的其他所有文件

作者: 极度嫌弃 | 来源:发表于2019-05-10 18:19 被阅读0次

只有二级目录的情况

//.ignore忽略文件夹中除了指定的文件外的其他所有文件
**/node_modules/*//忽略文件夹node_modules
!**/node_modules/vue-html5-editor/ //不包含vue-html5-editor文件夹

如果有多级目录
要保留:vue-html5-editor.js

//错误写法
**/node_modules/*//忽略文件夹node_modules
!**/node_modules/vue-html5-editor/dist/  //这样写是不生效的

//正确写法
**/node_modules/*
!**/node_modules/vue-html5-editor/
**/node_modules/vue-html5-editor/*
!**/node_modules/vue-html5-editor/dist

相关文章

网友评论

      本文标题:git .ignore忽略文件夹中除了指定的文件外的其他所有文件

      本文链接:https://www.haomeiwen.com/subject/aeczoqtx.html