{"thread":{"id":"28713","subject":"Problems after deleting submodule","startedAt":"2011-10-18T11:54:45Z","lastAt":"2011-10-19T10:23:11Z","messageCount":3,"participants":["Howard Miller","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"177945","messageId":"CAHVO_90UN_nNDbqxM2TkUjo_qfVhLgjUJoZTmYi6rsLnRMOUFg@mail.gmail.com","threadId":"28713","inReplyTo":null,"subject":"Problems after deleting submodule","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2011-10-18T11:54:45Z","receivedAt":"2011-10-18T11:54:45Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":"I included a submodule in my project then decided I didn't like\nsubmodules and deleted it again. I followed the advice of delting\n.gitmodules, the bit from .git/config and then git rm'ing the\nsubmodule. Seemed to work. I then copied files with the same directory\nname into where the submodule was. However, I can't add them.\n\nDoing git add /path/to/old/submodule - does nothing, files are not\nstaged, no error messages no nothing.\nIf I try to git rm /path/to/old/submodule - it just says 'did not\nmatch any files'.\n\nIt simply does not seem to want to add anything to the old submodule\nlocation. I had a grep around and could not see any obvious references\nin the repo.\n\nI'm a bit stuck... any suggestions for things I can try much appreciated.\n"},{"id":"177965","messageId":"4E9DD9E0.80808@web.de","threadId":"28713","inReplyTo":"CAHVO_90UN_nNDbqxM2TkUjo_qfVhLgjUJoZTmYi6rsLnRMOUFg@mail.gmail.com","subject":"Re: Problems after deleting submodule","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2011-10-18T19:56:16Z","receivedAt":"2011-10-18T19:56:16Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 18.10.2011 13:54, schrieb Howard Miller:\n> I included a submodule in my project then decided I didn't like\n> submodules and deleted it again. I followed the advice of delting\n> .gitmodules, the bit from .git/config and then git rm'ing the\n> submodule. Seemed to work. I then copied files with the same directory\n> name into where the submodule was. However, I can't add them.\n> \n> Doing git add /path/to/old/submodule - does nothing, files are not\n> staged, no error messages no nothing.\n> If I try to git rm /path/to/old/submodule - it just says 'did not\n> match any files'.\n> \n> It simply does not seem to want to add anything to the old submodule\n> location. I had a grep around and could not see any obvious references\n> in the repo.\n> \n> I'm a bit stuck... any suggestions for things I can try much appreciated.\n\nLooks like the gitlink entry of the submodule is still there. I assume\n\tgit ls-files --stage | grep 160000\nstill shows the submodule? That would make it impossible to add anything\nin the former submodule directory.\n\nWhen I delete .gitmodules and the .git/config entry and do a\n\tgit rm sub/\nI get\n\tfatal: pathspec 'sub/' did not match any files\n\nIf I omit the trailing slash it is:\n\tfatal: git rm: 'sub': Is a directory\n\nI have to do a\n\trm -rf sub\nfollowed by\n\tgit rm sub\nto get everything cleaned up.\n\nDoes that help you?\n"},{"id":"177992","messageId":"CAHVO_919up2OBtWDA5cvhOSzmN0QJG3FpxBi7D5_qLbtw3ETbg@mail.gmail.com","threadId":"28713","inReplyTo":"4E9DD9E0.80808@web.de","subject":"Re: Problems after deleting submodule","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2011-10-19T10:23:11Z","receivedAt":"2011-10-19T10:23:11Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":"On 18 October 2011 20:56, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 18.10.2011 13:54, schrieb Howard Miller:\n>> I included a submodule in my project then decided I didn't like\n>> submodules and deleted it again. I followed the advice of delting\n>> .gitmodules, the bit from .git/config and then git rm'ing the\n>> submodule. Seemed to work. I then copied files with the same directory\n>> name into where the submodule was. However, I can't add them.\n>>\n>> Doing git add /path/to/old/submodule - does nothing, files are not\n>> staged, no error messages no nothing.\n>> If I try to git rm /path/to/old/submodule - it just says 'did not\n>> match any files'.\n>>\n>> It simply does not seem to want to add anything to the old submodule\n>> location. I had a grep around and could not see any obvious references\n>> in the repo.\n>>\n>> I'm a bit stuck... any suggestions for things I can try much appreciated.\n>\n> Looks like the gitlink entry of the submodule is still there. I assume\n>        git ls-files --stage | grep 160000\n> still shows the submodule? That would make it impossible to add anything\n> in the former submodule directory.\n>\n> When I delete .gitmodules and the .git/config entry and do a\n>        git rm sub/\n> I get\n>        fatal: pathspec 'sub/' did not match any files\n>\n> If I omit the trailing slash it is:\n>        fatal: git rm: 'sub': Is a directory\n>\n> I have to do a\n>        rm -rf sub\n> followed by\n>        git rm sub\n> to get everything cleaned up.\n>\n> Does that help you?\n\nYes - that was exactly the problem. I'm slightly embarrassed I missed\nthat. For some reason the initial delete of the submodule left the\nempty directory in place (could have been a mistake on my part). I\ndidn't notice when I copied the new files back but it was enough to\nbreak it.\n\nI can't help thinking there could be some warning when doing an 'add'\nbut I don't think I have my head around it enough :)\n\nAnyway, thanks for the help (again) everyone!\n"}]}