Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

.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を変更する

KumanoT
合同会社kumanote代表/ソフトウェアエンジニア/インフラ構築〜クライアントまで幅広く
https://kumano-te.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away