Git push 代码时报错“The requested URL returned error: 403”的解决办法

参考 The requested URL returned error: 403


报错信息如下:

$ git push
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 197 bytes | 197.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

原因:

  • 原因: 由于之前连接过别的git仓库,提交时默认读取之前的username和password;

解决方法:

  • 控制面板 -- > 用户账号 --> window 凭据 删除之前的就好了,再次上传时就会提示需要输入当前仓库的账号和密码