1

I accidentally create a repo around another repo.
I now just want the inner repo to just become part of the outer repo (I don't want a submodule/multi repos).

I went into the inner repo a removed the .git folder, but running git status doesn't show any changes and if I try and explicitly git add a file from the inner repo I get:

fatal: Pathspec 'xfile.md' is in submodule 'x'

I tried to reinit git from the outer repo but no luck.

I simply want to remove in the inner repo and make it become part of the parent repo. Had a google and a stack overflow search but answers seemed to get in depth pretty quickly.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
friartuck
  • 2,954
  • 4
  • 33
  • 67

1 Answers1

1

Since you did not use git submodule deinit, the manual step would involve:

git rm --cached inner_repo
rm -f .git/modules/inner_repo
# edit .gitmodules

Replace 'inner_repo' by the root folder name of your inner repo.
Don't add a trailing '/' at the end of inner_repo.
And edit the .gitmodules to remove the section which has inner_repo in it.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250