我无法让我的 Git .gitignore 文件忽略包含我的 Vim 插件包目录的目录。我在 macOS Mojave 上运行 Git 2.22.0 版。我运行 Vim 8.0 并使用 Vundle 来管理我的 Vim 插件。我的 Vim 插件目录结构如下所示:
/Users/smith/dotfiles/.vim/bundle/Vundle.vim
/Users/smith/dotfiles/.vim/bundle/ansible-vim
/Users/smith/dotfiles/ctrlp.vim
...
我的 Git 目录的根目录是 /Users/smith/dotfiles。
这些捆绑目录中的每一个都包含自己的 Git 存储库,因此当我运行“git status”时,每个目录都会看到类似这样的内容:
modified: .gitignore
modified: .vim/bundle/Vundle.vim (new commits)
...
我不知道如何使用 Vundle 以忽略每个包的 .git 目录的方式安装这些包。也许我应该使用子模块,但我没有。
我不认为我真的需要跟踪这些捆绑目录并且宁愿让 Git 忽略它们。但无论我在 .gitignore 文件中放了什么,每当我运行“git status”时,我仍然会看到这些包含新提交的捆绑目录。
这是我的 .gitignore:
other/ipythop/profile_default/history.sqlite
.DS_Store
.vim/.netrwhist
.vim/bundle/
*.*.swp
我尝试了很多事情:
.vim/bundle/
.vim/bundle
.vim/bundle/*
我什至尝试像这样包含每个目录,但这并不妨碍它们出现:
.vim/bundle/Vundle.vim
我究竟做错了什么?