I’m keeping track of my dotfiles with a git repository under $HOME/.dotfiles
which is configured to track files in $HOME
(I used git config core.worktree "../../"
).
This method works fine as long as regular files are concerned, but it fails when I try to add a submodule. Eg:
~/.dotfiles $ git submodule add git@github.com:ardagnir/vimbed.git ../../.vim/bundle/vimbed/
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
I also tried ../.vim/...
and $HOME/.vim/...
.
Is it possible to add a submodule when core.worktree
is set to a parent of the repo’s default directory? If so, how what command should I use?