git remote add 添加一個(gè)遠(yuǎn)程地址
但提交出現(xiàn)以下報(bào)錯(cuò)
failed to push some refs to 'https://gitee.com/xxxxx/xxx-admin.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.
VBNET 復(fù)制 全屏
解決
也就是說(shuō),如果您確定處于分離狀態(tài)的master版本是您真正想要保留的版本,那么您可以通過(guò)強(qiáng)制將分支推送到遠(yuǎn)程來(lái)避免非快進(jìn)錯(cuò)誤:git push origin HEAD:master --force
但是,如果強(qiáng)制推送,則可能會(huì)給簽出該分支的所有其他用戶造成問(wèn)題。風(fēng)險(xiǎn)較小的解決方案是從分離的頭創(chuàng)建一個(gè)臨時(shí)分支,然后將該分支合并到主分支中:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-729400.html
git branch temp-branch
git checkout master
git merge temp-branch
git push origin master
說(shuō)明?Git推動(dòng)主人致命:你目前不在分支上 - IT屋-程序員軟件開(kāi)發(fā)技術(shù)分享社區(qū)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-729400.html
到了這里,關(guān)于git 提交出現(xiàn) Updates were rejected 解決方案記錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!