简体   繁体   中英

git clone --recurse-submodules fails silently

I have added a submodule to one of my repositories hosted on GitLab. In my browser GitLab displays the correct submodule@commit entry and the .gitmodules also looks okay. However, if I clone the repository using --recurse-submodules , the folder which should contain the submodule is empty.

I realize that this is impossible to diagnose without further information (which I cannot provide) but all I'd like to know here is how to go about debugging this myself since git fails to provide any information on what's gone wrong.

EDIT: I believe I've figured it out. I'm on Windows (which I forgot to tag, sorry about that) and my .gitmodules contained submodule paths using escaped backslashes (which I thought was correct), manually changing those to forward slashes fixed the problem.

You can try this after cloning you repository:

$ git submodule init
$ git submodule update --remote

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM