1、git remote add origin git@github.com:WadeLeng/hello-world.git 報(bào)錯(cuò)
- 錯(cuò)誤提示:fatal: remote origin already exists.
- 解決辦法:git remote rm origin
- 然后再執(zhí)行:$ git remote add origin git@github.com:WadeLeng/hello-world.git 就不會(huì)報(bào)錯(cuò)誤了
2、git push 提交后報(bào)403錯(cuò)誤
- 網(wǎng)上都說是要修改項(xiàng)目目錄下的隱藏文件 .git里面的config文件,但本人試過,行不通;
- 403主要原因是權(quán)限不足,不能訪問;
解決方法:在github官網(wǎng)的個(gè)人賬號(hào)要驗(yàn)證郵箱,如果不驗(yàn)證的話,就會(huì)提交push時(shí)報(bào)403的錯(cuò)誤。
3、 使用git push -u 遠(yuǎn)程庫(kù)名 master 命令將本地提交的內(nèi)容傳到git遠(yuǎn)程庫(kù)時(shí)出現(xiàn)錯(cuò)誤,如圖示:

原圖.jpg
解決方法:使用 git push -f 命令重新傳一遍即可;
結(jié)果顯示:

正確.png