我正在开发一个节点js项目,并且正在创建一个节点模块,现在想将其添加到我正在处理的项目中。所以在我的gitignore中,我输入了以下内容,但没有用
node_modules/*
!node_modules/zephyr-rest
zephyr-rest是一个目录,因此我只想保存该目录及其文件。我不希望对node_modules下的任何其他子目录进行版本控制。谢谢
试试这个,为我工作。
node_modules/*
!node_modules/zephyr-rest/
之后git status
它会像这样显示
Untracked files:
(use "git add <file>..." to include in what will be committed)
node_modules/
不用担心,因为不是每个子git status
文件夹untracked
都告诉最顶层的未跟踪文件夹,所以这表明存在一个未跟踪的文件夹node_modules
。要做的git add node_modules
只是添加node_modules/zephyr-rest/
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句