如何使用ssh auth在代码提交存储库上使用go get命令?

时间:2019-05-20 09:04:03

标签: git go

我是GO和AWS的新手。我已成功遵循这里https://github.com/google/battery-historian的说明,并且能够使项目在本地运行。现在,我想将其托管在我们的AWS代码提交上,因为我们不使用git。我创建了一个像这样的新存储库:

battery-historian/
    activity
    aggregated
    ...
    setup.go

,然后尝试运行以下命令;

go get -d -u ssh://git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian/...来自我的Linux终端

我不断收到“无效字符':”。我猜这是因为ssh协议。如果我不使用协议就可以运行

package git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian/...: unrecognized import path "git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian" (parse https://git-codecommit.us-west-1.amazonaws.com/v1/repos/battery-historian?go-get=1: no go-import meta tags ())

我以前使用过代码提交,只使用过ssh,并且运行良好。我已经使用我的Amazon User和rsa密钥修改了.ssh / config文件。

如何使用ssh auth在代码提交存储库上使用go get命令?

我看过What's the proper way to "go get" a private repository?,但无法正常运行。所有示例均适用于Github。如果我正常克隆存储库,然后运行go get -u,我将得到

-init --recursive
fatal: No url found for submodule path 'third_party/closure-library' in .gitmodules
package github.com/google/battery-historian: exit status 128

0 个答案:

没有答案