问题描述
用界面操作,推送后,出现如下错误:
git.exe push --progress "origin" master:master
remote: Permission to jessicawtt/t1.git denied to lvye1221.
fatal: unable to access 'https://github.com/jessicawtt/t1/': The requested URL returned error: 403
解决办法:
编辑 项目目录下 .git/config 中,找到如下代码位置,修改 url 中如下部分:
- 【注意】需要将地址中的 用户名、密码 替换成自己的真实账号及密码
将:
[remote "origin"]
url = https://github.com/jessicawtt/t1/
fetch = +refs/heads/*:refs/remotes/origin/*
改成:
[remote "origin"]
url = https://用户名:密码@github.com/jessicawtt/t1/
fetch = +refs/heads/*:refs/remotes/origin/*
方法2: 在当前项目文件夹中,打开 Git Bash,执行如下命令,实现修改访问url的问题:
git remote set-url origin https://用户名:密码@github.com/jessicawtt/t1/
再次重新推送,即可发现推送成功,如下图所示:
![Uploading 2_075017.png . . .]
参考资料
403 Forbidden
http://blog.csdn.net/hellochenlian/article/details/45367487