git 提交代码到github错误处理

时间:2023-03-09 04:50:47
git 提交代码到github错误处理

git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/hjyoung/php-redis-in-action.git/info/refs

修改配置

vim .git/config

将配置

[remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        url = https://github.com/hjyoung/php-redis-in-action.git

修改为

url = https://hjyoung@github.com/hjyoung/php-redis-in-action.git

再次push,输入密码,上传成功