Git one repo dependent on another

gitversion control

I have a git repository that is built with one library and during compiling the library is switched for another to get 2 versions of compiled code for 2 different libraries. (different versions of the same software)

This method has been working until now.

Now I have received a new 3rd library that differs significantly in some classes. I would like to keep the codebase same and just change the parts of the code where there are issues wrt. to the new library.

Question is, how to go about setting up a second repository that is linked to the master branch of the first repo ?. I want to do development only in the main repo and then sync the changes to the second repo and change only the code that is relevant wrt. libraries.

Is this the right way to go about this problem? or is there another way.

Thanks!

Best Answer

If I understand your problem correctly it should be possible to do this with a separate remote bransch.

Create a new branch: git checkout -b feature_branch_name

Edit, add and commit your files.

Push your branch to the remote repository: git push -u origin feature_branch_name

Then set up a build for each branch library combination in your CI environment.

Make a good plan for pushing and merging or addapt Git Flow.

Related Topic