最近重装了系统,重新安装git后操作git push就报以下错误,试了网上各种方法后终于发现了一个办法解决。
问题描述:
$ git push remote: Access denied fatal: unable to access 'https://gitee.com/xxx/xxxx.git/': The requested URL returned error: 403
解决方法:
1、终端输入:vim .git/config 就是打开git的config配置文件。
2、找到下面一句
[remote "origin"] url = https://github.com/xxx/example.git
修改为:
[remote "origin"] url = https://youname@gitee.com/xxx/example.git
保存并退出(youname是你的账号名称,@后面是项目地址)
3、再次git push,正常提示输入密码框,至此OK。
参考文章:http://linuxkiss.com/github/213.html