如何使用 ssh 访问 flutter 中的私人回购包?

How to access private repo packages in flutter using ssh?

我在 github 中有私人仓库,并在我的项目中将其用作包。在 pubspec.yaml 我是这样写的。

dependencies:
  shared_preferences: ^0.4.3
  atomic_app_customer_musteat_id:
    git: git@github.com:organization/my_github_repo_ssh .git
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

但是我的 github_repo"

中的错误是 "Could not find a file named "pubspec.yaml"

我在我的帐户中添加了 ssh,并尝试在 github 中配置机器用户。然后我尝试将其更改为正常的https link,并且没有错误。但是当我尝试在 bitrise 中构建 ci/cd 时出现错误。

pub get failed (69) -- attempting retry 5 in 16 seconds...
Git error. Command: git fetch
fatal: not a git repository 

但还是想不出如何解决这个问题。

像这样使用 url 行:

dependencies:
  my_project:
    git:
      url: ssh://git@gitserver/path/my_project.git

使用这种格式,前面不需要加ssh

dependencies:
<module_name>:
  git:
    url: git@github.com:<username>/Project.git

请确保您已正确配置 ssh-agent。