You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure your ssh key is properly configured in your github account, and it matches your user name
First test that it works as is, and observe that the remote is using SSH rather than https despite cloning http:
❯ git clone https://github.com/Rahix/avr-hal-template
Cloning into 'avr-hal-template'...
...
❯ cd avr-hal-template/
❯ git remote -v
origin ssh://git@github.com/Rahix/avr-hal-template (fetch) <-------------- THESE TWO MUST BE ssh://git@...
origin ssh://git@github.com/Rahix/avr-hal-template (push)
❯ cd ..
❯ rm -rf avr-hal-template/
Run cargo generate --git https://github.com/rahix/avr-hal-template
❯ cargo generate --git https://github.com/rahix/avr-hal-template
Error: Please check if the Git user / repository exists.
Caused by:
invalid or unknown remote ssh hostkey; class=Ssh (23); code=Certificate (-17)
Expected behavior
generation should start
Desktop (please complete the following information):
Error: Please check if the Git user / repository exists.
Caused by:
all authentication attempts failed
As a workaround, I commented out the insteadOf directive in my ~/.gitconfig, and cargo generate was able to authenticate and download everything correctly.
Describe the bug
If a user has automatic git redirect from https to ssh,
cargo generate
fails with theinvalid or unknown remote ssh hostkey
error.make sure you
rustup update
cargo install cargo-generate
.gitconfig
, provide all sections that contains one of:insteadOf
,url
To Reproduce
~/.gitconfig
(on Linux), add this section:cargo generate --git https://github.com/rahix/avr-hal-template
Expected behavior
generation should start
Desktop (please complete the following information):
rustc --version
: rustc 1.67.1 (d5a82bbd2 2023-02-07)cargo generate --version
: cargo generate-generate 0.17.6The text was updated successfully, but these errors were encountered: