2016-09-15 82 views
4

我是AWS新手,我正在实施持续交付给我工作的公司。亚马逊CodeCommit错误:git:'credential-aws'不是git命令

我跟着此说明配置CodeCommit服务:

为AWS CodeCommit初始配置要用于访问AWS CodeCommit创建和配置的IAM用户:http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-account

步骤1 我创建了一个新的IAM用户并给了他AWSCodeCommitFullAcess

安装和配置AWS CLI:我安装ED和配置的凭据做AWS配置(设置默认域的域名为AWS访问密钥ID,AWS访问密钥,美东-1和DE

第2步:安装Git的 我安装了GIT的窗户确保启用Git Credential Manager选项已被清除。

步骤3:设置凭据助手 我执行这些命令:

git config --global credential.helper "!aws codecommit credential-helper [email protected]" 
git config --global credential.UseHttpPath true 

执行:

git config --global --edit 

我有:
[HTTP]
sslVerify =假

[凭证]
h elper = “AWS codecommit列表库codecommit凭据帮手”
UseHttpPath =真

第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故障排除解决方案,我发现:http://docs.aws.amazon.com/codecommit/latest/userguide/troubleshooting.html#troubleshooting-ae1但我无法解决它。

有没有人知道如何解决这个问题? Pleeeeease,帮助!

回答

4

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

[credential]  
    helper = !aws codecommit credential-helper [email protected] 
    UseHttpPath = true 

顺便说一句,如果你使用的是猛砸模拟器,而不是Windows命令行的,你必须使用单引号代替双引号。

让我知道这是行不通的。

+0

打开命令提示符并使用Gi​​t运行git config,指定使用AWS凭证配置文件使用Git凭证助手,该助手使Git凭证助手能够将路径发送到存储库: 'git config --global credential.helper“!aws codecommit credential-helper $ @”' 如果您使用的是Bash模拟器而不是Windows命令行,则必须使用单引号而不是双引号。 http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-credential-helper – shrimpwagon

0

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