Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update submodule in github due to exist directory

I am using submodule to control my plugin in MacVim. When I tried to update the submodule using git update submodule It comes out:

fatal: destination path 'bundle/ShowMark' already exists and is not an empty directory.
Clone of 'git://github.com/vim-scripts/ShowMarks.git' into submodule path 'bundle/ShowMark' failed

I tried my own solution: remove the directory and then git update submodule It works but the MacVim cannot run properly. MacVim cannot open any new/old files.

like image 301
code4j Avatar asked Sep 06 '25 03:09

code4j


2 Answers

a general solution worked for me

git submodule deinit --force . 
git submodule init 
git submodule update --recursive
like image 122
Mohammad Kanan Avatar answered Sep 10 '25 01:09

Mohammad Kanan


It'si possible MacVim has issue opening files in bundle/ShowMark because the actual repo name on GitHub is ShowMark**s**(.git).

It might be better if that submodule was register to be in bundle/ShowMarks.
See "How do I move an existing git submodule within a git repository?" for more on that step.

like image 24
VonC Avatar answered Sep 10 '25 02:09

VonC