Reputation: 3385
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
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)git add aFolder
)git commit -m "Import aFolder content"
)You should now see aFolder
content in your GitHub repository.
Upvotes: 13