我是AWS世界的新手,我正在为我工作的公司实施持续交付。
我按照此说明配置了CodeCommit服务:http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-https-windows.html#setting-up-https-windows-account
步骤1:AWS CodeCommit的初始配置
创建和配置IAM用户以访问AWS CodeCommit : 我创建了一个新的IAM用户并给了他AWSCodeCommitFullAcess
安装和配置AWS CLI :我安装并配置了执行 aws configure 的凭据(将AWS Access Key ID,AWS Secret Access Key,默认区域名称设置为us-east-1和de
第2步:安装Git 我为Windows安装了GIT,确保已清除Enable Git Credential Manager选项。
第3步:设置凭证助手 我执行这些命令:
git config --global credential.helper "!aws codecommit credential-helper $@"
git config --global credential.UseHttpPath true
执行:
git config --global --edit
我有:
[http]
sslVerify = false
[凭证]
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上寻找故障排除解决方案,我发现:http://docs.aws.amazon.com/codecommit/latest/userguide/troubleshooting.html#troubleshooting-ae1但我无法解决它。
有人知道如何解决这个问题吗? Pleeeeease,帮助!
答案 0 :(得分:17)
我认为问题出在您的.gitconfig文件中。将其更改为下方,它应该有效。
[credential]
helper = !aws codecommit credential-helper $@
UseHttpPath = true
顺便说一句,如果您使用的是Bash模拟器而不是Windows命令行,则必须使用单引号而不是双引号。
如果这不起作用,请告诉我。
答案 1 :(得分:0)
如果你正在使用 cygwin ,那么在创建存储库之后,单击连接信息按钮,选择linux而不是windows,它适用于我的。
答案 2 :(得分:0)
我在使用 Python 3.8.x 时遇到了这个问题 - 请确保您使用的是 Python 3.7.x,如文档中所示