0

I've been working on an iteration of my portfolio site and recently finished making a lot of improvements to it. I had made a copy of the root folder to make these changes and meant to copy and paste the new code into the old folder with its contents already in GitHub (the older version of the site). I forgot about this and mistakenly ended up with a portfolio repository inside an older portfolio repository. When I then tried the copy+paste method, committing the code failed I keep getting the errors:

  Error: fatal: No url found for submodule path '[name of new portfolio root]' in .gitmodules
  Error: The process '/usr/bin/git' failed with exit code 128

How can I fix this issue so I can commit my site?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
feralzelda
  • 41
  • 3
  • first fix the `repository in repository` by copy paste the files to a temp directory, remove the repos, clone the repo again and copy/move over the new files – rioV8 Apr 14 '23 at 16:39

1 Answers1

1

If you have a nested repository inside your project repository:

  • delete its subfolder

  • delete the gitlink entry (the element named after that subfolder name)

    git rm --cached subfolder # no trailing /
    
  • commit the deletion

    git commit -m "Record subfolder gitlink deletion"
    
  • git push to complete the process.

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