{"thread":{"id":"60859","subject":"Bug: git submodule update doesn't give a prompt to add pubkey of remote repo host, and failed because of it.","startedAt":"2024-02-06T16:07:19Z","lastAt":"2024-02-06T16:07:19Z","messageCount":1,"participants":["DingJunyao"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"488075","messageId":"37a01273.7951.18d7f2c5303.Coremail.dingjunyao0703@163.com","threadId":"60859","inReplyTo":null,"subject":"Bug: git submodule update doesn't give a prompt to add pubkey of remote repo host, and failed because of it.","fromName":"DingJunyao","fromEmail":"dingjunyao0703@163.com","sentAt":"2024-02-06T16:07:07Z","receivedAt":"2024-02-06T16:07:19Z","isPatch":false,"sender":{"key":"dingjunyao0703@163.com","avatar":null},"body":"Git version: git version 2.43.0.windows.1\nOS: Windows 11 22H2 (22621.3007)\n(I don't know whether it's a Windows-specific bug)\n\nI 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.\n\nI executed the command in project directory:\n\n    git submodule init\n    git submodule update\n\nWhen updating, the following error happened:\n\n    Cloning into '/path/to/submodule'...\n    Host key verification failed.\n    fatal: Could not read from remote repository.\n\n    Please make sure you have the correct access rights\n    and the repository exists.\n    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed\n    Failed to clone 'themes/anzhiyu-ding-mod'. Retry scheduled\n    Cloning into '/path/to/submodule'...\n    Host key verification failed.\n    fatal: Could not read from remote repository.\n\n    Please make sure you have the correct access rights\n    and the repository exists.\n    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed\n    Failed to clone 'path/to/submodule' a second time, aborting\n\nI 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.\n\n    The authenticity of host 'host (XXX.XXX.XXX.XXX)' can't be established.\n    ED25519 key fingerprint is SHA256:XXXXXXXXXXXXX.\n    This key is not known by any other names.\n    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes\n    Warning: Permanently added 'host' (ED25519) to the list of known hosts.\n\nAfter that, I tried to execute `git submodule update` in the previous project and succeeded.\n\nI 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."}]}