Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git rm, gives scary "Deletion of directory failed" when I only delete one file

Tags:

git

~/repo/samples>git rm subviews.js
rm 'samples/subviews.js'
Deletion of directory 'samples' failed. Should I try again? (y/n) n

Why does it try to delete directory when I clearly told that I want to delete the file?

To make it more clear:

The same directory contains about 10 more files and they are also tracked by git.

like image 224
exebook Avatar asked Apr 12 '13 07:04

exebook


2 Answers

Likely, the directory samples would be empty after the file removal. Git would normally delete it then, however since your shell's working directory is also in the same directory, removal fails.

like image 170
Michael Wild Avatar answered Nov 19 '22 06:11

Michael Wild


Upgrade to the latest version of msysgit.

I've had this for a long time with msysgit v1.7.11. After upgrading to v1.8.5 the problem disappeared.

like image 23
Roman Starkov Avatar answered Nov 19 '22 04:11

Roman Starkov