1

In my local, I made a git repo out of an existing codebase, which (unbeknownst to me) contained a git repo within it. When this created some scary looking errors about HEAD being corrupt, I went and deleted the .git folder in the inner repo.

Now Bitbucket considers this folder a submodule that points to a repo that I can't access (since it's not mine). However, locally, git submodule does not recognise any submodules existing.

As naturally follows, any clean pull from this repo just contains an empty folder where the inner repo is.

What I want is to tell Bitbucket to forget about the submodule, and replace that with the folder contents I have in my local copy; effectively "merging" this phantom submodule into the parent repo.

How can I do that?

Emphram Stavanger
  • 4,158
  • 9
  • 35
  • 63
  • Have you tried removing the submodule with https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule or https://gist.github.com/myusuf3/7f645819ded92bda6677 (except the step where you delete the actual folder), then add the local folder to git? If `git submodule deinit` fails, try the second link which uses more low-level commands. – hsandt May 16 '19 at 22:42

0 Answers0