0

I have a project (a phpBB forum) based on multiple repositories hosted in GitHub. I'd want to host this code somewhere not available to the public (like GitLab).

So I have this environment:

  • / <- (private) modifications I made to phpBB (but on their releases, not their current code).
  • /styles/mystyle <- (private) modifications I made to Artodia's Simplicity theme
  • /ext/vendor/extension <- several extensions, from several people, each on its own GitHub repo. I've modified some of them. I also made some, som of which I want to keep a private copy and some others I want to share in GitHub.

Right now, I have a single big repository in GitLab. But I cannot fetch further commits made by the original authors of these softwares.

Which setup should I follow? I've read something about submodules, is this the path I should follow?

nerestaren
  • 137
  • 11

1 Answers1

0

I'd handle it with regular repos and submodules like this:

First of all, for all the repos you want to change compared to what their authors provide do the following: make a fork on GitHub, then import that fork in GitLab.

After it's imported, set the upstream to the original author's GitHub repo (for example, for the phpBB one it'd be git remote add upstream https://github.com/phpbb/phpbb). What this will do is allow you to pull in changes from the original repo even though you're hosting it privately in GitLab (see Keep your fork synced). The only caveat is to keep all your changes in a separate branch starting from their release.

OK, now you should have in GitLab all the repositories to which you want to make custom changes (phpBB, the theme and the extensions you don't want to share).

Step 2 would be to clone on your machine the phpBB one from GitLab (/), then add the theme and each extension you want as a module (see here how to add a submodule to a specific path and here how to set which commit it should point to).

Now you should have your full structure, only with code hosted on private GitLab repos. So when you want to update your theme, you update the theme repo in GitLab and push to your custom branch; after the theme gets updated by the author for example, you switch to the master branch, pull changes from upstream, then rebase your custom branch on the master, and in the end update the submodule in the main repo (the phpBB one).

Community
  • 1
  • 1
Serban Constantin
  • 2,846
  • 1
  • 12
  • 18