解决码云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'.
相关推荐
go54631584657 小时前
本地部署 GitHub 上的 Python 人脸识别项目
开发语言·python·github
程序视点1 天前
惊喜升级!Claude 3.7 Sonnet 上线 GitHub Copilot!已全账号开放!
github·claude·github copilot
今晚打老虎z1 天前
MailKit: 在 .NET 中实现高效电子邮件发送与接收
git·github·.net
架构文摘JGWZ1 天前
5个GitHub热点开源项目!!
学习·github·工具
液态不合群2 天前
DeepSeek “源神”启动!「GitHub 热点速览」
github
JNU freshman2 天前
github 推送的常见问题以及解决
git·github
cjchsh2 天前
ctfhub-web信息泄露通关攻略
windows·python·github
五行缺觉3282 天前
ROS ur10机械臂添加140夹爪全流程记录
c++·经验分享·机器人·github·ur机械臂·moveit!
無炆_2 天前
IDEA-插件开发踩坑记录-第五坑-没有飞机场导致无法访问GITHUB导致的讨厌问题
java·github·intellij-idea
cccccchd2 天前
github如何创建空文件夹
github