Open abernix opened 2 years ago
This could maybe partially be fixed by #40, which adds more authentication mechanisms, including using the ssh agent and more default keys in addition to ~/.ssh/id_rsa
.
I'm not sure about the insteadOf
. That sounds like libgit2
simply doesn't implement it, so using auth-git2
would not solve that.
My authentication with GitHub is done with SSH keys (rather than
https://
) and I use a Yubikey to provide my SSH keys. I assure you that mygit
commands work properly. 😉To ensure I use
git+ssh
rather thanhttps://
for cloning things, I have the following in my~/.gitconfig
:So, proving my
git
works:However, when I try this with
cargo-scaffold
using thehttps://
URL, I receive:... and with the
git+ssh
approach:Ultimately, I think this comes down to the same challenge that
cargo
ran into by trying to use an underlyinggit
library that wasn't a full implementation of thegit
CLI's abilities — for example, theCARGO_NET_GIT_FETCH_WITH_CLI
env variable and its corresponding setting. (For what it's worth, I tried using that env variable, but it didn't help, though I'm not surprised since that'scargo
-specific behavior).Those limitations are explained a bit in https://github.com/rust-lang/cargo/blob/9ded34a558a900563b0acf3730e223c649cf859d/src/cargo/sources/git/utils.rs#L816-L905 where you can see how they work around it.