2016-09-15 72 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,它適用於我的。