git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug: git submodule update doesn't give a prompt to add pubkey of remote repo host, and failed because of it.

From
DDingJunyao <dingjunyao0703@163.com>
Date
Feb 6, 2024, 16:07 UTC
Message-ID
<37a01273.7951.18d7f2c5303.Coremail.dingjunyao0703@163.com>
Git version: git version 2.43.0.windows.1
OS: Windows 11 22H2 (22621.3007)
(I don't know whether it's a Windows-specific bug)
I cloned a project from one remote repo (A), and the project has a submodule from the other remote repo (B). Both of them are connected to the remote repo of which by SSH, and I added my pubkey to both of the repo providers.
I executed the command in project directory:
    git submodule init
    git submodule update
When updating, the following error happened:
    Cloning into '/path/to/submodule'...
    Host key verification failed.
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed
    Failed to clone 'themes/anzhiyu-ding-mod'. Retry scheduled
    Cloning into '/path/to/submodule'...
    Host key verification failed.
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed
    Failed to clone 'path/to/submodule' a second time, aborting
I cloned another repo from B. When I did it, I found I hadn't added the pubkey of repo B to the list of known hosts before.
    The authenticity of host 'host (XXX.XXX.XXX.XXX)' can't be established.
    ED25519 key fingerprint is SHA256:XXXXXXXXXXXXX.
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'host' (ED25519) to the list of known hosts.
After that, I tried to execute `git submodule update` in the previous project and succeeded.
I think when I update submodule and I haven't added the key to the submodule remote repo, it needs to give a prompt to add the public key, just like cloning.
Message 1 of 1 in “Bug: git submodule update doesn't give a prompt to add pubkey of remote repo host, and failed because of it.”
  1. DingJunyaoFeb 6, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.