报错项:
[root@tyzZ SHELL]# git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/Tuesdday/ShellScriptsPractice.git/info/refs
解决方案:
vim .git/config
将
[remote "origin"]
url = https://github.com/Tuesdday/ShellScriptsPractice.git
fetch = +refs/heads/*:refs/remotes/origin/*
改为:
[remote "origin"]
url = https://Tuesdday@github.com/Tuesdday/ShellScriptsPractice.git
fetch = +refs/heads/*:refs/remotes/origin/*
保存退出,重新提交
[root@tyzZ SHELL]# git push -u origin master
Password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 232 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://Tuesdday@github.com/Tuesdday/ShellScriptsPractice.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
成功解决~