在 Windows 上将 SourceTree 连接到 AWS CodeCommit

Sam*_*iri 2 git amazon-web-services atlassian-sourcetree aws-codecommit

我使用 Atlassian 的 SourceTree 在 Windows 10 上与 git 配合使用,并选择 AWS CodeCommit 作为远程托管服务器。

我按照这个并没有发现问题。

以下是给出的错误

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.
Run Code Online (Sandbox Code Playgroud)

Von*_*onC 6

403 表示权限被拒绝:不知何故,您的 AWS 凭证未正确发送到远程 Amazon 服务器。

本教程涉及凭据的部分是:

git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
Run Code Online (Sandbox Code Playgroud)

如果您为 AWS CodeCommit 创建了特定的 AWS 凭证配置文件,您可以指定要使用哪个配置文件,例如 CodeCommitProfile:

git config --global credential.helper '!aws --profile CodeCommitProfile codecommit credential-helper $@'  
Run Code Online (Sandbox Code Playgroud)

这是您需要仔细检查的部分 ( git config -l)。首先确保先决条件aws configure已正确完成。