简体   繁体   中英

Synchronise 2 repositories in git

I have my main project hosted in GitHub. Everything is good and works.

Now I'm trying to create a Solaris port. I make myself an OpenSolaris VM installed Solaris Studio as compiler/IDE and built.

Everything works fine.

Now what I'm thinking is that since Solaris Studio is completely different IDE/compiler from MSVC/Anjuta/Xcode, I should create a different repository (NOT A FORK) and push Solaris stuff there.

The only problem is - code synchronization.

If I make the change in my main repository and push it to remote, I want my second repository to be updated as well with the changes to the *.cpp/.h files.

Is there exist some kind of hook to do that?

Or maybe I'm better off with creating a fork? But then changes to the build system will be overwritten.

Please advise.

This is the current structure for the main project:

Project folder -> main app folder (*.cpp, *.h, *.sln, Makefile.am/Makefile.in, xcodeproj folder)
                     |
                     ----> library 1 folder (*.cpp, *.h, *.sln, Makefile.am/Makefile.in, xcodeproj folder)

Or maybe I'm better off with creating a fork? But then changes to the build system will be overwritten.

I wouldn't even bother with a fork.

I would just make sure the build system is isolated in its own folder, which allows you to have in one repository two build configuration folders:

  • one for a default environment
  • one dedicated to a Solaris environment

That way, you can go on contributing to the code, from either one of those environments, without having to deal with any synchronization issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM