一、error: failed to push some refs to ‘https://gitee.com/xxx/xxx.git‘錯誤的解決方法。
解決方法1:直接輸入git push origin master -f 強(qiáng)行把本地的分支覆蓋掉遠(yuǎn)程倉庫的分支
解決方法2:出現(xiàn)錯誤的主要原因是gitee(github)中的README.md文件不在本地代碼目錄中 ,所以我們只需要git pull --rebase origin master命令README.md拉到本地。然后執(zhí)行g(shù)it push origin master即可提交。
二、error: unable to access ‘https://gitee.com/XXX.git/‘: The requested returned error: 403
錯誤原因是無權(quán)限訪問我們只要找到帳戶
然后輸入憑據(jù),找到憑據(jù)管理器
然后編輯我們自己的賬號就可以了。文章來源:http://www.zghlxwxcb.cn/news/detail-537869.html
三、當(dāng)我們在另一臺電腦拉取代碼時,再次上傳至gitee上,需要我們再次連接gitee賬號
git config --global user.name “郵箱”
git config --user,email “用戶名”
之后的操作:文章來源地址http://www.zghlxwxcb.cn/news/detail-537869.html
// 初始化倉庫
git init
// 查看狀態(tài)
git status
// 添加至本地
git add .
// 提交
git commit -m "第一次提交"
//添加gitee地址(這里是你的項(xiàng)目地址 .git文件)
git remote add origin https://gitee.com/xxx
//推送代碼到遠(yuǎn)程倉庫
git push -u origin master
到了這里,關(guān)于git 常遇到的幾種錯誤(failed to push some refs to ,The requested returned error: 403)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!