I am not a bot
I am not a bot

Reputation: 33

Converting a submodule to a folder within a GitHub repo

I'm new to using GitHub and I read up a few of the solutions on stack overflow but I couldn't understand them. I pushed a folder in one of my repository and it shows up as a gray submodule. I need it to be a regular directory inside my repo. Can someone simplify what I need to do or show steps because I don't know how to deal with submodules or .gitmodules or where to find them

Thanks in advance!

Upvotes: 1

Views: 150

Answers (1)

VonC
VonC

Reputation: 1324537

If you don't see a .gitmodule at the root of your main repository, that means your subfolder is a nested git repo, recorded as a gitlink (a SHA1 reference), which is what you see as a grayed folder.

All you need to do is:

  • delete the .git subfolder you should find in that folder
  • go back to the main repo (one folder up)
  • add, commit and push: that should push the folder content instead of a tree SHA1 reference.

Upvotes: 1

Related Questions