2016-11-19 102 views
1

我最近有一個git衝突,而不是正確處理它,我沒有真正修復任何衝突,而是做了一些事情,如用另一個克隆的另一個版本覆蓋文件或者將文件移出目錄,或者執行git reset --soft或其他複雜的一系列命令。Windows 7 - git衝突後無法刪除的文件

無論如何,我一直在我的文件系統上留下一些我無法刪除的文件。我不能移動它們,重命名它們,在命令行中用DEL刪除它們,或者用gitbash中的RM刪除它們。該文件被命名爲:

pom.xml~9b19d48... dpom_refactor 

它有0個字節,我不知道如何擺脫它。我不再有任何.git文件夾,所以我不能使用任何git命令來回滾我所做的。每當我嘗試刪除/移動/重命名,我得到的錯誤:

Could not find this item 

This is no longer located in C:\<filePath>. Verify the item's location and try again. 

任何想法如何我可以擺脫它?

回答

0

這種無效的Windows文件名可以用like a nul file來處理。

C:\> rename \\.\C:\..\pom.xml~9b19d48... dpom_refactor del.txt 
C:\> del del.txt 

Using the \\.\ prefix tells the high-level file I/O functions to pass the filename unparsed to the device driver

如果這是失敗,只有dedicated tool (or Live Linux distro CD)將能夠掛載磁盤和刪除文件。