Github 推送失败403问题解决

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

解决办法:

方法1:编辑 项目目录下 .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/

发表回复