LoginSignup
2
2

More than 3 years have passed since last update.

Rustでprivate repositoryを~/.ssh/configを効かせてインポートする

Posted at

.cargo/configに設定する

defaultだとcargoが~/.ssh/configを参照してくれないので以下を追加

~/.cargo/config

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

Cargo.tomlでの指定

Cargo.toml

[dependencies]
pkg-name = { version = "0.1.0", git = "ssh://git@your-repo-host/git-user-or-group/pkg-name.git", branch = "master" }

key points

gitのフォーマットもcloneする時のURLを使うとエラーになる
- ssh: をいれる
- host:username になっていたら host/username などにpathを変更する

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2