git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems after deleting submodule
@ 2011-10-18 11:54 Howard Miller
  2011-10-18 19:56 ` Jens Lehmann
  0 siblings, 1 reply; 3+ messages in thread
From: Howard Miller @ 2011-10-18 11:54 UTC (permalink / raw)
  To: git

I included a submodule in my project then decided I didn't like
submodules and deleted it again. I followed the advice of delting
.gitmodules, the bit from .git/config and then git rm'ing the
submodule. Seemed to work. I then copied files with the same directory
name into where the submodule was. However, I can't add them.

Doing git add /path/to/old/submodule - does nothing, files are not
staged, no error messages no nothing.
If I try to git rm /path/to/old/submodule - it just says 'did not
match any files'.

It simply does not seem to want to add anything to the old submodule
location. I had a grep around and could not see any obvious references
in the repo.

I'm a bit stuck... any suggestions for things I can try much appreciated.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems after deleting submodule
  2011-10-18 11:54 Problems after deleting submodule Howard Miller
@ 2011-10-18 19:56 ` Jens Lehmann
  2011-10-19 10:23   ` Howard Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Lehmann @ 2011-10-18 19:56 UTC (permalink / raw)
  To: Howard Miller; +Cc: git

Am 18.10.2011 13:54, schrieb Howard Miller:
> I included a submodule in my project then decided I didn't like
> submodules and deleted it again. I followed the advice of delting
> .gitmodules, the bit from .git/config and then git rm'ing the
> submodule. Seemed to work. I then copied files with the same directory
> name into where the submodule was. However, I can't add them.
> 
> Doing git add /path/to/old/submodule - does nothing, files are not
> staged, no error messages no nothing.
> If I try to git rm /path/to/old/submodule - it just says 'did not
> match any files'.
> 
> It simply does not seem to want to add anything to the old submodule
> location. I had a grep around and could not see any obvious references
> in the repo.
> 
> I'm a bit stuck... any suggestions for things I can try much appreciated.

Looks like the gitlink entry of the submodule is still there. I assume
	git ls-files --stage | grep 160000
still shows the submodule? That would make it impossible to add anything
in the former submodule directory.

When I delete .gitmodules and the .git/config entry and do a
	git rm sub/
I get
	fatal: pathspec 'sub/' did not match any files

If I omit the trailing slash it is:
	fatal: git rm: 'sub': Is a directory

I have to do a
	rm -rf sub
followed by
	git rm sub
to get everything cleaned up.

Does that help you?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems after deleting submodule
  2011-10-18 19:56 ` Jens Lehmann
@ 2011-10-19 10:23   ` Howard Miller
  0 siblings, 0 replies; 3+ messages in thread
From: Howard Miller @ 2011-10-19 10:23 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: git

On 18 October 2011 20:56, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 18.10.2011 13:54, schrieb Howard Miller:
>> I included a submodule in my project then decided I didn't like
>> submodules and deleted it again. I followed the advice of delting
>> .gitmodules, the bit from .git/config and then git rm'ing the
>> submodule. Seemed to work. I then copied files with the same directory
>> name into where the submodule was. However, I can't add them.
>>
>> Doing git add /path/to/old/submodule - does nothing, files are not
>> staged, no error messages no nothing.
>> If I try to git rm /path/to/old/submodule - it just says 'did not
>> match any files'.
>>
>> It simply does not seem to want to add anything to the old submodule
>> location. I had a grep around and could not see any obvious references
>> in the repo.
>>
>> I'm a bit stuck... any suggestions for things I can try much appreciated.
>
> Looks like the gitlink entry of the submodule is still there. I assume
>        git ls-files --stage | grep 160000
> still shows the submodule? That would make it impossible to add anything
> in the former submodule directory.
>
> When I delete .gitmodules and the .git/config entry and do a
>        git rm sub/
> I get
>        fatal: pathspec 'sub/' did not match any files
>
> If I omit the trailing slash it is:
>        fatal: git rm: 'sub': Is a directory
>
> I have to do a
>        rm -rf sub
> followed by
>        git rm sub
> to get everything cleaned up.
>
> Does that help you?

Yes - that was exactly the problem. I'm slightly embarrassed I missed
that. For some reason the initial delete of the submodule left the
empty directory in place (could have been a mistake on my part). I
didn't notice when I copied the new files back but it was enough to
break it.

I can't help thinking there could be some warning when doing an 'add'
but I don't think I have my head around it enough :)

Anyway, thanks for the help (again) everyone!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-19 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 11:54 Problems after deleting submodule Howard Miller
2011-10-18 19:56 ` Jens Lehmann
2011-10-19 10:23   ` Howard Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).