解决码云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'.
相关推荐
CoderJia程序员甲1 小时前
GitHub 热榜项目 - 日榜(2025-08-16)
人工智能·ai·开源·github
xiaoerbuyu12332 小时前
仿微信听书进度条
gitee
python_1365 小时前
web请求和响应
java·spring·github
一宿君8 小时前
Github 9 个惊艳的开源 NL2SQL 项目
sql·nlp·github
x10n910 小时前
GitHub宕机时的应急协作方案
github
深圳多奥智能一卡(码、脸)通系统1 天前
以下是对智能电梯控制系统功能及系统云端平台设计要点的详细分析,结合用户提供的梯控系统网络架构设计和系统软硬件组成,分点论述并补充关键要点:
github
掘金安东尼1 天前
使用自定义高亮API增强用户‘/’体验
前端·javascript·github
星哥说事1 天前
如何将堡塔云WAF迁移到新的服务器
服务器·git·github
uhakadotcom1 天前
使用postgresql时有哪些简单有用的最佳实践
后端·面试·github
用户4099322502121 天前
如何在FastAPI中玩转APScheduler,实现动态定时任务的魔法?
后端·github·trae