Scrungepipes
Scrungepipes

Reputation: 37581

Unable to remove a directory in git

I have an empty git directory I'd like to remove, however

"git rm -r NameOfDirectory" is returning "operation not permitted".

In addition, if I move a new file into this directory then do git status, git does not list it as a new untracked file, but it does if I move the file into another directory, so there's something strange about it.

How I can get rid of this directory?

git rm -r -f doesn't solve it.

Upvotes: 0

Views: 2953

Answers (2)

TheEwook
TheEwook

Reputation: 11117

It's a permission issue.

try

sudo git rm -r NameOfDirectory with the root password

You may try to remove the directory without using the git command but the rm command directly.

rm -r NameOfDirectory or sudo rm -r NameOfDirectory

Upvotes: 2

CB Bailey
CB Bailey

Reputation: 792129

Git doesn't track empty directories. If you have an empty directory in your working tree you should simply removed it with rmdir. There is no need to involve Git.

Upvotes: 1

Related Questions