简体   繁体   English

Git 克隆 git 代码提交存储库给出 403 错误

[英]Git clone for git codecommit repository giving 403 error

I am trying to clone a aws codecommit repository but I'm getting Unable to access: 403 error.我正在尝试克隆 aws codecommit 存储库,但出现无法访问:403 错误。

I am using credential helper for connecting to codecommit.我正在使用凭据帮助程序连接到 codecommit。

This is my.gitconfig file.这是 my.gitconfig 文件。

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

I have configured the aws profile using access key Id and secret access key.我已经使用访问密钥 ID 和秘密访问密钥配置了 aws 配置文件。 Also I cleared all the git credentials before accessing the repository, but still getting the same error everytime.此外,我在访问存储库之前清除了所有 git 凭据,但每次仍然遇到相同的错误。

Any help will be appreciated.任何帮助将不胜感激。

Mac OS user here. Mac OS 用户在这里。 Also stumbled upon this 403 issue and spent lots of time looking through AWS docs.还偶然发现了这个 403 问题,并花了很多时间查看 AWS 文档。 Finally, this little thing saved my day (or should I say night):最后,这个小东西拯救了我的一天(或者我应该说是晚上):

Open Keychain Access app and look for an entry with git-codecommit-...-amazonaws.com and cached Internet password.打开 Keychain Access 应用程序并查找包含 git-codecommit-...-amazonaws.com 和缓存的 Internet 密码的条目。

See the picture看图片

You can safely delete this row, as this password expires anyway after 15 minutes.您可以安全地删除此行,因为此密码将在 15 分钟后过期。 And voila.瞧。 Pesky 403 is gone and commit is in the cloud.讨厌的 403 消失了,提交在云端。 Hope this helps anyone who is looking for a fast straight-forward solution...希望这可以帮助任何正在寻找快速直接解决方案的人......

PS Unfortunately, this is just a quick fix, as on the next attempt to access your repository you will still face the same issue and will need to clear the cached password again. PS 不幸的是,这只是一个快速修复,因为在下次尝试访问您的存储库时,您仍然会遇到同样的问题,并且需要再次清除缓存的密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM