我正在使用Atlassian的SourceTree在Windows 10上使用git,并选择AWS CodeCommit作为远程托管服务器。
我followed这个,找不到问题。
以下是给出的错误
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin
fatal: unable to access 'https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/repoName/': The requested URL returned error: 403
Completed with errors, see above.
403表示权限被拒绝:以某种方式您的AWS凭证未正确发送到远程Amazon服务器。
涉及凭证的part of the tutorial为:
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
如果您为AWS CodeCommit创建了特定的AWS凭证配置文件,则可以指定要使用的配置文件,例如CodeCommitProfile:
git config --global credential.helper '!aws --profile CodeCommitProfile codecommit credential-helper $@'
这是您需要仔细检查(git config -l
)的部分。确保先正确执行前提条件aws configure
。
当我的AWS密码过期并且我已重置密码时,它开始对我发生。由于凭据过时,本地git开始给我403错误。我尝试使用普通的aws帐户登录凭据连接到codecommit,这再次给了我同样的403错误。最后,我意识到我需要通过AWS账户设置生成新的git凭证并使用它们。那解决了我的问题。