Rob V
Rob V

Reputation: 51

Github: Using multiple forks/clones in new repository (long)

I'm obviously new to GitHub, and want to make sure I do things right before I dive in.

I want to create a new repository that uses forks/clones from 2 existing projects. The existing projects are not mine.

So let's say the repo's I want to use are called Repo A from developer 'Da' and Repo B from developer 'Db'

I would fork Repo A, then clone it I would fork Repo B, then clone it

Here is where it gets fuzzy - I now want to merge the 2 into a new Repo (C).

This is where I get lost - not just regarding how to do this, but more regarding what do I push back up to the forked repos? I assume Repo A doesn't want the Repo C stuff? Or does it?

Also, how do you put the licensing info, and 'credit' to the original developers in Repo 'C' ?

Any help is appreciated. I tried searching for it, but could not find a clear answer.

Upvotes: 3

Views: 271

Answers (1)

VonC
VonC

Reputation: 1328292

The cleaner way, which would still keep each repo separated while allowing you to record A and B together, would be to declare a parent repo (C), with A and B as submodules.

That will simply put A and B as subdirectories of C, that won't actually merge their codebase together, though.

C   => remote: your own C on GitHub
|
--A => remote: forkA on GitHub
|
--B => remote: forkB on GitHub

As I explain in "true nature of submodules", you still can make changes directly within the A and B submodules, while recording the new combined state in C.

Upvotes: 2

Related Questions