Sean
Sean

Reputation: 3385

How do I fix the white arrow on the folder thing on GitHub even after deleting the .git folder?

I recently made the mistake of pushing to my repository while having a .git folder inside another folder. Doing so has resulted in unclickable folders with white arrows on them on my GitHub repository. Clicking on the commit message shows Submodule XYZ added at abc123.

I've proceeded to go into that folder and do rm -rf .git, but I'm unable to undo the process.

I've taken a look at this other relevant question and did what is suggested, but the proposed solutions don't seem to apply to my case.

Does anyone know how I may be able to undo this? Thanks.

Upvotes: 4

Views: 3941

Answers (1)

VonC
VonC

Reputation: 1325107

You should:

  • git rm --cached afolder (no trailing slash), with 'aFolder' being the name of the folder in which there was a .git/ subfolder (that you already removed)
  • commit (git commit -m "remove nested Git repository reference")
  • add (git add aFolder)
  • commit again (git commit -m "Import aFolder content")
  • and push

You should now see aFolder content in your GitHub repository.

Upvotes: 13

Related Questions