我運行Xcode,它自動運行git
操作。這可能會導致一些rebase -i
操作失敗,如果Xcode啓動操作比git
更快。這導致:如何在「無法創建'.git/index.lock':文件存在」後繼續重新綁定。「?
fatal: Unable to create '.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
Xcode的任務完成之前,我可以做任何事情,所以index.lock
已經過去了,我應該準備好繼續。
好的,所以我試試git rebase --continue
,因爲其他操作已經完成了,現在應該沒有index.lock
了。然而,這迅速鼓起,一個錯誤信息,如:
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
Otherwise, please use 'git reset'
interactive rebase in progress; onto abcdef
Last commands done (X commands done):
pick abcdef Something
pick abcdef Something
Next commands to do (Y remaining commands):
pick abcdef Something
pick abcdef Something
You are currently rebasing branch 'foo' on 'abcdef'.
nothing to commit, working directory clean
Could not apply abcdef
在這一點上,我乾脆放棄,--abort
,並再次啓動。我失去了我制定的重組策略,以及我解決的任何衝突。我能做些什麼來正確恢復這個過程,不會丟失任何數據?
對於這個問題,「重新綁定之前關閉Xcode」並不是我正在尋找的答案。假設我已經忘記這麼做了,並且處於這種不良狀態(另外,Xcode需要永久啓動,而且這種情況很少發生)。
當我重新運行rebase時,它應用乾淨(或至少會產生相同的衝突)。 – JHZ