1

I accidentally added a cloned git repository to a working copy clone of my repository, and pushed the changes to my remote. I did not use git submodule to do that, but rather did something like "git add somedir.git".

Now whenever I clone my repo, I get an empty "somedir.git" directory. I cannot do a "git rm -r somedir", because git complains "somedir.git is a directory".

How can I get rid of this directory or convert it into a proper submodule? The directory is completely empty after cloning, not even a .git/ folder in there.

2
  • have you tried to simply rm -rf somedir.git, and then commit its deletion? Commented Jun 21, 2012 at 8:54
  • cool, added as an answer Commented Jun 21, 2012 at 9:33

1 Answer 1

2

Git fails at deleting the directory because it is empty, it has always been tricky with empty directory (BTW it's not clear to me why cloning the repo gives you this empty directory!)

Simply rm -rf somedir.git and commit its deletion.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.