解决码云gitee或者github出现The requested URL returned error: 403

出现场景

要把某个项目push到码云上,已经设置了仓库地址,在最后一步直接报错。

bash 复制代码
adodeMacBook-Pro:yimabao ado$ git push --set-upstream origin master
remote: [session-774b45b9] Access denied
fatal: unable to access 'https://gitee.com/mzmilk/yimabao.git/': The requested URL returned error: 403

解决方案

打开钥匙串,种类选择所有项目,在右边搜索git。

找到github或者gitee,删除对应的项目即可。

弹出窗口,选择删除。

再重新pull或者push,会提示输入密码和账号,输入正确的就能正常pull、push了。

bash 复制代码
adodeMacBook-Pro:yimabao ado$ git push --set-upstream origin master
Username for 'https://gitee.com': xxxxxx@qq.com
Password for 'https://xxxxxx@qq.com@gitee.com':
Enumerating objects: 158, done.
Counting objects: 100% (158/158), done.
Delta compression using up to 4 threads
Compressing objects: 100% (136/136), done.
Writing objects: 100% (158/158), 268.65 KiB | 5.97 MiB/s, done.
Total 158 (delta 25), reused 0 (delta 0)
remote: Resolving deltas: 100% (25/25), done.
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/mzmilk/yimabao.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
相关推荐
掘我的金21 分钟前
Text2Light 安装案例:从 GPU 可用到 OpenEXR 报错,再到顺利出图(Windows + Conda)
github
杨杨杨大侠34 分钟前
第3章:实现基础事件总线
java·github·eventbus
杨杨杨大侠36 分钟前
第4章:添加注解支持
java·github·eventbus
libokaifa38 分钟前
C++ 基础学习
前端·架构·github
wallflower20201 小时前
从零到全流程 CI/CD:多技术栈项目自动化部署实战与优化指南
ci/cd·github
绝无仅有1 小时前
某大厂MySQL面试之SQL注入触点发现与SQLMap测试
后端·面试·github
绝无仅有2 小时前
某互联网大厂的面试go语言从基础到实战的经验和总结
后端·面试·github
止观止2 小时前
GitHub App 架构解析与最佳实践
架构·github
小韩博3 小时前
Windows权限提升(二)
windows·网络安全·github
小马哥编程12 小时前
DNS解析中的服务器协作机制
服务器·git·github