解决码云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'.
相关推荐
草梅友仁44 分钟前
草梅 Auth 1.1.0 发布与最新动态 | 2025 年第 30 周草梅周报
开源·github·ai编程
mortimer2 小时前
安装NVIDIA Parakeet时,我遇到的两个Pip“小插曲”
python·github
心之语歌5 小时前
Spring AI MCP 客户端
人工智能·spring·github
yeshan3337 小时前
使用 Claude Code 的自定义 Sub Agent 完善博文写作体验
ai·github·agent·claudecode
程序视点8 小时前
望言OCR 2025终极评测:免费版VS专业版全方位对比(含免费下载)
前端·后端·github
玩个冰球9 小时前
Stata 18下载安装教程(非常详细),看完这一篇就够了(附安装包)
github
Xi_Xu9 小时前
Xget:下一代开源资源获取加速引擎,让你的文件下载、储存库克隆和镜像拉取快如闪电
开源·github
用户40993225021211 小时前
FastAPI的查询白名单和安全沙箱机制如何确保你的API坚不可摧?
前端·后端·github
计算机毕设定制辅导-无忧学长14 小时前
InfluxDB Flux 查询协议实战应用(二)
github
不念霉运17 小时前
2025 Gitee vs. GitLab:全面对比与选择指南
gitee·gitlab