如果你在多个github账户之间切换,并在不同的github上克隆了仓库时,那么在提交代码的时候就会容易出现403错误,如下:
![](http://upload-images.jianshu.io/upload_images/11156470-10e0ef0a2d6f6cd8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1200/format/webp)
image
这个错误信息其实很明显,就是你要提交的github和你当前的github不是一个账号,我在网上搜索一下,也有很多种解决办法,下面介绍其中一种,亲测有效:
打开终端输入:
rundll32.exe keymgr.dll,KRShowKeyMgr
在弹出的框中选择github并编辑
![](http://upload-images.jianshu.io/upload_images/11156470-2981fa6b0887d446.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1200/format/webp)
image
在下拉框中选择需要的账户,输入密码,点击确定
![](http://upload-images.jianshu.io/upload_images/11156470-0e79d34575b4d682.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/676/format/webp)
image
再重新push就可以成功了。