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,输入密码,上传成功

原文地址:https://www.cnblogs.com/hjyang2012/p/6052810.html