I have a git repository that I keep my vim configuration in. This tree includes a number of git submodules that refer to other people's repos which contain plugins.
As I'm interested in setting up a proper dotfiles repo with GNU stow, I thought the best way to integrate the vim repo was to just subtree it into the dotfiles repo. As my vim config is forked from someone else, I figured this way I could easily merge in changes made upstream while preserving my own plugins and config.
I've succesfully added the subtree to my repo, using git subtree add -P vim/.vim-files https:\\xx master --squash
. The resulting tree looks like this:
dotfiles/
├── .git
└── vim/
├── .vimrc
└── .vim-files/ <= THE SUBTREE
├── .gitmodules
└── plugins/
└── submodule1/
When I perform git submodule init
from dotfiles/
after that, it fails with fatal: No url found for submodule path 'vim/.vim-files/plugins/submodule1' in .gitmodules
. Even though the URL is there and the subtree repo has no problems with submodules when used standalone.
The stranger part is, when I cd into .vim-files
and run the command there, the error looks like this: fatal: No url found for submodule path 'vim/.vim-files/vim/.vim-files/plugins/submodule1' in .gitmodules
.
Can anyone explain what causes this behaviour? Are subtrees and submodules incompatible or have I stumbled upon a bug?