1、問(wèn)題
error: update_ref failed for ref 'refs/heads/master': cannot lock ref 'refs/heads/master': is at 63654e79f7ae0f902731558b3ae6679a69db09e9 but expected ec20d6ffa52920358e54703f90100bedbca4c855 error: could not update refs/heads/master
2、場(chǎng)景
由于為了方便解決沖突獲取到最新遠(yuǎn)程代碼(并且本地有沖突代碼不想要),直接刪除了本地分支想重新創(chuàng)建同名分支,導(dǎo)致報(bào)錯(cuò)。
3、原因
問(wèn)題不能復(fù)現(xiàn)待補(bǔ)充
4、解決方案
參考文章0
參考文章1
5、擴(kuò)展
熟悉windows系統(tǒng)的話,windows下,文件名不區(qū)分大小寫(xiě),所以導(dǎo)致它們兩個(gè)文件不能共存。
Git是區(qū)分大小寫(xiě)的,所以可以存在兩個(gè)大小寫(xiě)不同但名字是一樣的分支。文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-602734.html
Windows系統(tǒng)的文件,是不區(qū)分大小寫(xiě)的,導(dǎo)致.git\refs\remotes\origin下只存在小寫(xiě)的文件,以致于git pull時(shí)commit id不一致的問(wèn)題。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-602734.html
到了這里,關(guān)于[Bug0034] Git報(bào)錯(cuò) cannot lock ref 'refs/heads/master': is at xxxx but expected xxx error: could not ...的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!