解決在git push時的報錯:error: failed to push some refs to 'https:/
// 錯誤如下
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
根據(jù)提示,翻譯是要合并的庫和本地庫不一致,要先執(zhí)行git pull操作
在網(wǎng)上找了一些解決方案,都是執(zhí)行如下指令
git pull --rebase origin master
但是并沒有解決我的問題,也沒有一些更好的解決方案。
仔細思考了下,我要并入的并不是master這個主分支,而是我創(chuàng)建的一個新分支shuwwl_new_br
于是將上述指令改為文章來源:http://www.zghlxwxcb.cn/news/detail-510987.html
git pull --rebase origin shuwwl_new_br
再執(zhí)行git push指令,可以正常并入。
也算一個小問題吧,希望大家要檢查一下自己將要并入的分支,再執(zhí)行上述更新指令。文章來源地址http://www.zghlxwxcb.cn/news/detail-510987.html
到了這里,關于git push報錯:error: failed to push some refs to ‘https:/的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!