今天提交代码到Gitee突然提示如下错误:
remote: [session-dc49e5b1] Oauth: Access token is expired
fatal: unable to access https://gitee.com/xxx/xxx.git/ The requested URL returned error: 403
fatal: unable to access https://gitee.com/xxx/xxx.git/ The requested URL returned error: 403
原因:
这个问题其实就是因为你的本地电脑上安全中心存储Gitee密码过期导致的。
解决办法:
本以为修改下IDEA的settings下的Gitee账号密码就可以了,其实没用,就算删除了账号,再重新登录也没用。最终成功解决办法如下:
1)打开控制面板-用户帐户-凭据管理器
,选择Windows凭据
,然后找到名为git:https://gitee.com
的凭据点开,直接点击删除。如图:
2)然后打开IDEA去pull
或push
代码,会有如下安全中心的弹窗,输入Gitee的账号密码确定即可。
3)再去pull
或push
代码就发现正常了。
以上push代码带Gitee提示Oauth: Access token is expired的解决办法。