Git Push:error: Couldn't set refs/remotes/origin/master;error: update_ref failed for ref 'refs/remot

做者: 荒原之夢
原文連接: http://zhaokaifeng.com/?p=543

今天使用Git Push代碼時產生錯誤:

Rename from 'XXXX/.git/refs/remotes/origin/master.lock' to 'XXX/.git/refs/remotes/origin/master' failed. Should I try again? (y/n)

輸入y 還會重複出現上述提示,輸入n 則會出現下面的錯誤提示:git

error: Couldn't set refs/remotes/origin/master error: update_ref failed for ref 'refs/remotes/origin/master':

不過,雖然出現瞭如上錯誤提示,可是代碼是能夠正確Push到遠程倉庫的。markdown

問題解決過程:

進入.git/refs/remotes/origin目錄:app

cd .git/refs/remotes/origin

發現並無master.lock這個文件,因此想到是否能夠經過建立master.lock這個文件解決問題,輸入:測試

echo ref: refs/remotes/origin >master.lock

建立master.lock.spa

經測試,問題解決。
End
My Website:http://zhaokaifeng.com/code

相關文章
相關標籤/搜索