【问题标题】:AWS CodeCommit Error: git: 'credential-aws' is not a git commandAWS CodeCommit 错误:git:'credential-aws' 不是 git 命令
【发布时间】:2017-01-23 21:08:59
【问题描述】:

我是 Amazon Web Services 世界的新手,我正在为我工​​作的公司实施 Continuous Delivery

我遵循 AWS 的 [配置 CodeCommit 服务的说明] (http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-account)

第 1 步:AWS CodeCommit 的初始配置

创建和配置IAM user 以访问AWS CodeCommit: 我创建了一个新的 IAM 用户并给了他AWSCodeCommitFullAccess

安装和配置 AWS CLI

我安装并配置了执行aws configure 的凭据。 将 AWS 访问密钥 ID、AWS 秘密访问密钥、默认区域名称设置为 us-east-1de

第二步:安装 Git 我安装了Git For Windows,确保清除了启用 Git 凭据管理器选项。

第 3 步:设置凭据帮助程序

git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true

执行:

git config --global --edit

我的配置是:

[http]
  sslVerify = false
[credential]<br> 
  helper = "aws codecommit list-repositories codecommit credential-helper "
  UseHttpPath = true

第 4 步:连接到 AWS CodeCommit 控制台并克隆存储库

    $ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3<br>
    Cloning into 'teste-git-to-s3'...<br>
    git: 'credential-aws' is not a git command. See 'git --help'.<br>
    Username for 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3': Lucas<br>
    fatal: unable to access 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/teste-git-to-s3/': The requested URL returned error: 403

寻找AWS故障排除,我发现:Troubleshooting AWS CodeCommit但我无法解决。

如何解决?

【问题讨论】:

    标签: amazon-web-services amazon-iam aws-codecommit git-for-windows


    【解决方案1】:

    我认为问题出在您的 .gitconfig 文件中。将其更改为以下,它应该可以工作。

    [credential]    
        helper = !aws codecommit credential-helper $@ 
        UseHttpPath = true  
    

    顺便说一句,如果您使用的是 Bash 模拟器而不是 Windows 命令行,则必须使用单引号而不是双引号。

    如果这不起作用,请告诉我。

    【讨论】:

    • 打开命令提示符并使用 Git 运行 git config,指定使用带有 AWS 凭证配置文件的 Git 凭证助手,这使 Git 凭证助手能够将路径发送到存储库:git config --global credential.helper "!aws codecommit credential-helper $@"如果您使用 Bash 模拟器而不是 Windows 命令行,则必须使用单引号而不是双引号。 docs.aws.amazon.com/codecommit/latest/userguide/…
    • 我用的是 ZSH,我也遇到了同样的问题。
    【解决方案2】:

    如果您使用的是cygwin,在创建存储库后,单击连接信息按钮,选择 linux 而不是 windows,它适用于我的。

    【讨论】:

      【解决方案3】:

      我在使用 Python 3.8.x 时遇到了这个问题 - 请确保您使用的是 Python 3.7.x,如文档中所示

      【讨论】:

        猜你喜欢
        • 2012-11-19
        • 2020-12-22
        • 2022-12-21
        • 2022-07-06
        • 2022-12-28
        • 2019-08-18
        • 2023-03-20
        • 2018-10-29
        • 1970-01-01
        相关资源
        最近更新 更多