解决码云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'.
相关推荐
lambert.wang1 小时前
当使用 uv 下载 Python 解释器时出现异常,通常是因为网络连接问题导致无法从 GitHub 下载安装包
python·github·uv
TheNextByte11 小时前
如何将照片从计算机传输到Android /iPhone
android·gitee·iphone
Ama_tor1 小时前
obsidian插件系列|从github下载插件banners及简单应用
github·obsidian·banner
智绘前端1 小时前
GitHub 登录功能开发 SOP
人工智能·typescript·github·reactjs
CoderJia程序员甲1 小时前
GitHub 热榜项目 - 日榜(2026-01-29)
git·ai·开源·llm·github
Allen_LVyingbo4 小时前
医疗大模型预训练:从硬件选型到合规落地实战(2025总结版)
开发语言·git·python·github·知识图谱·健康医疗
Gogo8164 小时前
深度解析 GitHub Copilot Agent Skills:如何打造可跨项目的 AI 专属“工具箱”
人工智能·github·copilot
陌上花开缓缓归以18 小时前
Linux 5.4内核版本内核宏梳理
linux·网络·github
JavaGuide1 天前
屠榜 GitHub,被迫改名!2026 年最火的 AI 助手 Moltbot
ai·github
C澒1 天前
Gitee 分支管理规范
gitee·团队开发