-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failed to authenticate when downloading repository #3381
Comments
I believe this is a duplicate of #2078, but thanks for the report! |
Leave it here to help somebody...
|
I had the same setup in a global
This is a somewhat common for few reasons. One is to deal with git submodules in a unified way: so you don't need to handle Running |
I think part of your problem was that your
Not:
With the @deniskolodin replacement rule, |
oh good point, I was not aware of this difference. FWIW, there is some work happening in libgit2 that would allow to avoid all such problems all together libgit2/libgit2#4667 |
@HaoZeke it didn't fix my issue even if I use [url "[email protected]:"]
insteadOf = https://github.com/ |
it seems work after i comment [url "[email protected]:"]
insteadOf = https://github.com/ |
Just in case, somebody will land here from google with the same errors ( [net]
git-fetch-with-cli = true The following links from the docs saved my days: |
Life saver. https git has always caused issues so I've always forced ssh auth |
The problem appear when I set a dependencies and run |
Mark |
Workaround from #2078 (comment): To apply globally, add this to [net]
git-fetch-with-cli = true |
note: URL rewriting blocked `cargo-tarpaulin` from successfully installing and seems related to rust-lang/cargo#3381. Removing this line from git's config seemed to fix the problem.
note: URL rewriting blocked `cargo-tarpaulin` from successfully installing and seems related to rust-lang/cargo#3381. Removing this line from git's config seemed to fix the problem.
Wow, It's worked!!!! |
Forces `cargo` to use the `git` executable for git operations. See this GitHub issue for context: rust-lang/cargo#3381
Forces `cargo` to use the `git` executable for git operations. See this GitHub issue for context: rust-lang/cargo#3381
For future travellers this is what I use: # force authentication to use SSH rather than HTTPS.
# be aware this affects everything that tries to use git.
# for example, vim (and other tools) will try to clone plugins using SSH.
#
# git config --global --add url."[email protected]:".insteadOf "https://github.com/"
[url "[email protected]:"]
insteadOf = https://github.com/
# avoid issues where the cargo-edit tool tries to clone from a repo you do not have WRITE access to.
# we already use SSH for every github repo, and so this puts the clone back to using HTTPS.
[url "https://github.com/rust-lang/crates.io-index"]
insteadOf = https://github.com/rust-lang/crates.io-index
# avoid issues where the `cargo audit` command tries to clone from a repo you do not have WRITE access to.
# we already use SSH for every github repo, and so this puts the clone back to using HTTPS.
[url "https://github.com/RustSec/advisory-db"]
insteadOf = https://github.com/RustSec/advisory-db |
cargo install brakes if you've configured git to use ssh instead of http for github urls. explanation of the workaround here rust-lang/cargo#3381 (comment)
Just leaving another thing that helped me after none of the other things worked - I had multiple SSH keys saved in rsa and ed25519 files named
|
export CARGO_NET_GIT_FETCH_WITH_CLI=true |
Not a great experience for Rust newcomers... It took a while to find this seemingly hacky solution while following the documentation. |
Life saver! |
it doen't work for some cargo packages.. such as cargo audit will failed with ssh error |
Lifesaver! phew |
While going through the docs, this one hit me:
The reason I'm hitting this issue is buried in my gitconfig
I am aware that this bug is a byproduct of how I have things set up locally, but since I'm capable of cloning
https://github.com/rust-lang/crates.io-index
without any issues with the above settings, I was hoping that I'd be able to use cargo in that way as well.Thanks!
The text was updated successfully, but these errors were encountered: