无法从AWS CodeCommit仓库克隆。该仓库被认为是“未找到”。

9

我在从AWS CodeCommit存储库克隆代码时遇到了问题。

据我所见,我已经完成了所有必要的设置步骤。

  • 我已创建了存储库
  • 我已创建了git凭证
  • 我已执行以下操作来配置git...

    • git config --global credential.helper "!aws codecommit credential-helper $@"
    • git config --global credential.UseHttpPath true
  • 我已确认我的aws cli版本与credential-helper配合使用

  • 我已确认我的cli环境可以访问我的aws账户,并且当我运行以下命令时可以看到我的存储库...

    aws codecommit list-repositories

但是,当我尝试克隆存储库时,它立即返回...

fatal: repository 'https://git-codecommit.ap-southeast-2.amazonaws.com/[my-repo]' not found

它没有提示凭据。

如果我尝试直接使用 curl 访问仓库 URL,我会看到它返回了 401 状态码,这可能是正确的。

git version: 2.26.2.windows.1
aws cli version: aws-cli/2.0.17 Python/3.7.7 Windows/10 botocore/2.0.0dev21

我正在尝试在Windows 10 Pro上使用PowerShell进行操作。您有想法可能出了什么问题吗?

自那以后有任何成功吗?我正在面临同样的问题。 - seekingtheoptimal
1个回答

1

这对我很有效

您需要更改AWS配置文件以连接到存储库所在的账户:

在Windows中,可以使用以下方法完成:

setx AWS_PROFILE your_profile

接下来,您需要使用凭据助手配置git

git config --global credential.helper '!aws codecommit credential-helper $@'

现在你应该能够克隆你的仓库了


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接