git子模块已经存在,但它没有?

时间:2016-09-24 10:34:37

标签: linux git vim git-submodules

我有git repo:https://github.com/bbialek/dotfiles 我想为vim的病原体插件创建子模块。

cd ~/dotfiles/vim
git submodule add https://github.com/tpope/vim-pathogen .vim

它说:

  

' VIM /的.vim'已存在于索引

是不是因为我已经有了子模块 ../dotfiles/vim/.vim/bundles/*?

我的.gitmodules

    [submodule "vim/.vim/bundle/nerdtree"]
    path = vim/.vim/bundle/nerdtree
    url = https://github.com/scrooloose/nerdtree
[submodule "vim/.vim/bundle/vim-autoformat"]
    path = vim/.vim/bundle/vim-autoformat
    url = https://github.com/Chiel92/vim-autoformat
[submodule "vim/.vim/bundle/vim-colors-solarized"]
    path = vim/.vim/bundle/vim-colors-solarized
    url = https://github.com/altercation/vim-colors-solarized
[submodule "vim/.vim/bundle/vim-sensible"]
    path = vim/.vim/bundle/vim-sensible
    url = https://github.com/tpope/vim-sensible
[submodule "vim/.vim/bundle/YouCompleteMe"]
    path = vim/.vim/bundle/YouCompleteMe
    url = https://github.com/Valloric/YouCompleteMe
[submodule "tmux/.tmux/plugins/tpm"]
    path = tmux/.tmux/plugins/tpm
    url = https://github.com/tmux-plugins/tpm

1 个答案:

答案 0 :(得分:1)

您无法在声明的子模块路径中注册子模块(如vim/.vim/bundle/nerdtree

由于您已经有多个子模块使用.vim,因此您需要为.vim子模块存储库使用不同的文件夹。