0

I have a GIT question: Assuming there are two companies, each running its own GIT repository containing their projects. Now there is one project that they both work on and would therefore like to have that particular project in both repositories.

Now my questions: - Is this possible? - If it is, how can the Repos be synced?

Chris

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34

2 Answers2

0

git submodules will do that for you.

Andy
  • 44,610
  • 13
  • 70
  • 69
0

I'd add a post-receive hook to both company repos that check wherever a commit of that project was pushed to the current repo, it pushes it to the other too. It will create some additional traffic, but shouldn't create an infinite loop, as the hook shouldn't be called if there are no new commits. But beware of two people pushing to either repo at the same time - you'll have to handle cases where a git push is rejected and have someone resolve it manually.

Reactormonk
  • 21,472
  • 14
  • 74
  • 123