1

I want to put several of my git repos into one main repo while preserving the commit history.
Is this possible and how?

I tried just putting all these repos into one main parent, doing git add ., and then pushing.
But it shows commit or discard the untracked or modified content in submodules

commit or discard the untracked or modified content in submodules

And when pushed on Github, the folders are like this and unclickable.

the folders are like this and unclickable.

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

1 Answers1

0

when pushed on Github, the folders are like this and unclickable

Yes: you have pushed gitlinks, special entries in the index, representing the SHA1 of the nested sub-repository.

But the main parent does not know where to get those nested subrepos, so GitHub display a white arrow without any link.

The better approach would be, in your local main repository, to use the git submodule command, which would add and reference (in a .gitmodules file), those same repositories.

That supposes those children repositories are already pushed in their own remote Git repo hosting service, and addressable with a URL.

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