简体   繁体   中英

Update submodules for a Git repo cloned from local source

I've been trying to render a project from a template made with Copier, which contains a submodule converter , but faced a following issue:

Submodule 'converter' (/template_path/converter.git) registered for path 'converter'
fatal: repository '/template_path/converter.git' does not exist
fatal: clone of '/template_path/converter.git' into submodule path '/tmp/copier.vcs.clone.4y5n3ykb/converter' failed

where /template_path/ denotes a path to the local repository with template.

I've reproduced this by cloning a local version of repository with template into another local directory and updating submodules with following command:

git submodule update --checkout --init --recursive --force , which is exactly what is being called by Copier.

Both .gitmodules files in the original and cloned repos contain following path and url:

[submodule "converter"]
    path = converter
    url = ../converter.git

Config file in the original local repo contains valid url to the remote repository of converter submodule, but in the cloned one it has local path /template_path/converter.git .

How can I fix this?

An url =../converter.git would mean abare repository converter.git cloned alongside your current project repository.

If you don't have that repository (bare) cloned locally, then you would need to update the submodule repository URL ( using git submodule set-url ) in order to reference an external (non-local) repository (from GitHub, GitLab or any other public repository hosting service).

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