0

I was adding a directory in Git to create a new package. I cloned the src/ which I was going to include in my repository, and I think I forgot to rm -rf src/.git, so somehow post-commit, I have a blank directory with no source, and what appears to be a broken submodule.

I'd like to delete the src/ folder and re-create the directory and add the source files manually, but I'm getting errors.

git rm -f src/ gives me:

fatal: pathspec 'package/src/' did not match any files

Running git submodule gives:

No submodule mapping found in .gitmodules for path 'package/src/'

I have no .gitmodules file, and I don't want this to be a submodule. I'd just like it to delete this directory so I can re-create it and put the source contents in.

hichris123
  • 10,145
  • 15
  • 56
  • 70
user3526827
  • 153
  • 1
  • 1
  • 9
  • Have you tried this link- http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository – love Jul 21 '14 at 16:42
  • I don't want a blank directory, I want to add my source files. But if I add files to src/ at the moment, and do a git add on src, git commit -a does nothing, because it thinks it's a submodule. – user3526827 Jul 21 '14 at 16:49
  • Hey!! just try this command to delete "src" folder. I think it will help you to delete "git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch src" -- --all" . Once deleted, you may use your usual process of commiting your changes. – love Jul 21 '14 at 17:59
  • That worked. Had to force push obviously! – user3526827 Jul 21 '14 at 20:09

0 Answers0