1

I recently had a git conflict, and rather than dealing with it properly, I didn't actually fix any of the conflicts, but did something like overwrite the files with another version from another clone of the repo, or moved the files out of the directory, or did a git reset --soft, or some other convoluted series of commands.

Anyway, I've been left with some files on my filesystem that I cannot delete. I cannot move them, rename them, delete them with DEL in the command line, or with RM in gitbash. The file is named:

pom.xml~9b19d48... dpom_refactor 

It has 0 bytes, and I've no clue how to get rid of it. I no longer have any .git folder, so I can't use any git commands to rollback what I did. Whenever I attempt to delete/move/rename, I get the error:

Could not find this item

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

Any thoughts on how I could get rid of it?

zodac
  • 285
  • 10
  • 26

1 Answers1

0

This kind of invalid Windows filename could be dealt with 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

If that was to fail, only a dedicated tool (or Live Linux distro CD) would be able to mount that disk and remove the file.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250