1

I have a repository Named as "R1". This repository contain 4 Projects (P1,P2,P3 and P4).

I want to Link P1 with another repository R2 same P2 with R3. If I push the code on Repository R1 then it should be push for all linked repositories(R2 and R3).

Please suggest me if this is possible using GitHub.

Claudio
  • 10,614
  • 4
  • 31
  • 71
Vikas Gupta
  • 11
  • 2
  • 4

1 Answers1

1

There is no "automatic sync" between repo in Git or GitHub.

One possible implementation is:

That means, when you push anything in P1 or P2, or all you need to do in R1 or R2 is:

git submodule update --remote
git add .
git commit -m "new SHA1 for P1 or P2"
git push

R1 only monitors gitlinks (special entries in the index) for P1 or P2.

However that means more repos that you currently have: you had R1 and R2, you would need P1 and P2 as repos as well.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250