繁体   English   中英

AWS CodeCommit 错误:git:'credential-aws' 不是 git 命令

[英]AWS CodeCommit Error: git: 'credential-aws' is not a git command

我是亚马逊网络服务领域的新手,我正在为我工​​作的公司实施持续交付

我按照 AWS 的 [instructions to configure CodeCommit Service] ( http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-account )

步骤 1: AWS CodeCommit 的初始配置

: I created a new IAM user and gave him AWSCodeCommitFullAccess :我创建了一个新的 IAM 用户并给了他AWSCodeCommitFullAccess

:

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

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

步骤 3:设置凭证助手

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

执行:

git config --global --edit

我的配置是:

[http]<br> sslVerify = false
[credential]<br> helper = "aws codecommit list-repositories codecommit credential-helper " <br>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 故障排除,我发现: 故障排除 AWS CodeCommit但我无法解决。

如何解决这个问题?

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

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

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM