You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

git clone AWS Codecommit仓库返回403错误排查求助

问题根因

你的403错误由以下几个配置错误叠加导致:

  • Git凭证助手调用顺序错误:你配置了两个credential.helper,Git会按优先级先调用manager-core,拉取的凭证不匹配CodeCommit的鉴权要求
  • 配置项拼写错误:你写入的credentials.helper=UseHttpPath=true是完全错误的配置,正确配置项应为对应CodeCommit域名下的UseHttpPath参数,且credential不应带复数后缀s,也不属于helper的配置字段
  • 可能存在旧的无效凭证缓存在本地凭证管理器中

解决步骤

  1. 清理全局错误配置
    执行以下命令删除无效配置项:
# 删除多余的默认凭证助手配置
git config --global --unset credential.helper manager-core
# 删除拼写错误的配置项
git config --global --unset credentials.helper
  1. 写入正确的CodeCommit专属配置
# 配置AWS CodeCommit凭证助手
git config --global credential.helper '!aws codecommit credential-helper $@'
# 开启对应区域CodeCommit域名的UseHttpPath配置
git config --global credential."https://git-codecommit.us-west-2.amazonaws.com".UseHttpPath true
  1. 验证AWS凭证有效性
    执行aws sts get-caller-identity确认返回的身份ARN所属的IAM用户/角色,已被授予对应仓库的codecommit:GitPull权限。

  2. 清理本地缓存的无效凭证(Windows环境专属)
    打开控制面板→用户账户→凭据管理器→Windows凭据,删除所有git-codecommit.us-west-2.amazonaws.com相关的通用凭据,避免旧缓存干扰。

  3. 重新执行克隆命令即可。


内容的提问来源于stack exchange,提问作者Pronomita Dey

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 09:06:06