简体   繁体   English

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

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

I am new to Amazon Web Services world, and I am implementing Continuous Delivery to the company I work for.我是亚马逊网络服务领域的新手,我正在为我工​​作的公司实施持续交付

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

Step 1: Initial Configuration for AWS CodeCommit步骤 1: AWS CodeCommit 的初始配置

To create and configure an IAM user for accessing AWS CodeCommit : I created a new IAM user and gave him AWSCodeCommitFullAccess创建和配置IAM 用户以访问AWS CodeCommit :我创建了一个新的 IAM 用户并给了他AWSCodeCommitFullAccess

To install and configure the AWS CLI :要安装和配置 AWS CLI

I installed and configured the credentials doing aws configure .我安装并配置了凭据执行aws configure Setting AWS Access Key ID, AWS Secret Access Key, Default region name to us-east-1 and de将 AWS 访问密钥 ID、AWS 秘密访问密钥、默认区域名称设置为us-east-1de

Step 2: Install Git I installed Git For Windows making sure the Enable Git Credential Manager option was cleared.第 2 步:安装 Git为 Windows安装了Git ,确保清除了启用 Git 凭据管理器选项。

Step 3: Set Up the Credential Helper步骤 3:设置凭证助手

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

Executing:执行:

git config --global --edit

My Configuration is:我的配置是:

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

Step 4: Connect to the AWS CodeCommit Console and Clone the Repository步骤 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

Looking for AWS troubleshooting, I found: Troubleshooting AWS CodeCommit but I couldn't solve it.寻找 AWS 故障排除,我发现: 故障排除 AWS CodeCommit但我无法解决。

How can this be solved?如何解决这个问题?

I think the issue is in your .gitconfig file.我认为问题出在您的 .gitconfig 文件中。 Change it to below and it should work.将其更改为下面,它应该可以工作。

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

By the way, if you are using a Bash emulator instead of the Windows command line, you must use single quotes instead of double quotes.顺便说一下,如果您使用的是 Bash 模拟器而不是 Windows 命令行,则必须使用单引号而不是双引号。

Let me know if this doesn't work.如果这不起作用,请告诉我。

如果您使用的是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