0

I have a git repo with a gitlab remote. Inside of that repo I have a submodule folder connected to github. How can I make the outer repo treat the submodule like it was just another folder inside of it?

Right now when i make changes in the inner repo I don't see specific changes in the outer repo when running git status, allI see is that there have been new commits or there is modified content. This seems like the normal submodules behavior. On gitlab, it is not possible to see the files in the submodule since they are in the private github repo. This is my biggest issue since I need others to see the content of that submodule on gitlab. Submodules might not be the way to go here but how can I make the inner folder and all files in there visible in the outer repo while staying connected to both remotes?

I saw that in order to integrate a different git repo into another, submodules are suggested but it seems like there is no way to treat a submodule like a normal folder.

I saw this but I don't want to remove the connection to the private github repo.

Celdor
  • 26
  • 5
  • 2
    Either a submodule is a separate repository and the superproject (the parent repo) cannot track its content; or it's a normal tracked directory but then it's not a submodule and cannot be updated from its source repository; you cannot have it both ways at the same time. There is a middle ground to try: [tag:git-subtree]; see [the docs](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt). – phd Dec 11 '22 at 21:12
  • 1
    If others need to see it in GitLab, could you host a mirror of your private GitHub repo in GitLab? – joanis Dec 12 '22 at 03:44
  • @phd thanks git-subtree does the job. Only drawback is that the commands to push and pull are relatively long. – Celdor Dec 12 '22 at 12:01

0 Answers0