通过HTTPS 方式进行gti操作时,在push命令时,出现了这样一个问题:
The requested URL returned error: 403 Forbidden while accessing
导致无法推送自己的程序。经过一番搜索和测试,这里写一个最简单的解决办法:
在命令行中,更改远端仓库的地址,将自己的用户名加入到地址前方:
git remote set-url origin https://yourusername@github.com/user/repo.git
如我原来的 origin地址是: https://github.com/shincling/Initial_test_02.git
此时变成了: https://shincling@github.com/shincling/Initial_test_02.git
之后进行Push 操作,如 :git push origin master 就会有弹出框提示你输入密码
实际上还可以直接把密码也加入到origin中去来直接Push