Contents

Cargo Ssh Git

很多时候rust都依赖一些很新库,直接引用了git,这些git网址一般是https, 但是我一般都想使用ssh来连接。

Git 配置

~/.gitconfig中添加

[url "github:"]
	insteadOf = https://github.com/

github.ssh/config中的HostName

Cargo 配置

cargo 不会 读取 .ssh/config

但是,可以添加配置,使用git命令行来获取。在 ~/.cargo/config 中添加

[net]
git-fetch-with-cli = true