0

I'm in a development team doing some bugfixes for another company. The other company has our current code stored in their VCS, which is Git. However, only a few of us in the dev team have direct access to the Git repository via VPN.

Now we want to get our own copy of the repository, hosted on a machine within our own network, so that all of us can contribute. Then one of the developers that have access to the other company's Git can checkout and pull the new branches that are created in our own repo, VPN to the other company and push those branches.

How would I do that? Should I clone the original repository with --bare or with --mirror? Then copy the myrepo.git catalog to somewhere that's available for everybody in the dev team?

Another problem I'm seeing is that we can never be on the two networks at once, so we can never update the copy on our end?

Viktor
  • 403
  • 2
  • 7
  • 25

1 Answers1

0

--mirror is the one to go!! here the Doc

If you want to mirror a repository in another location, including getting updates from the original, you can clone a mirror and periodically push the changes.

and

Set up a mirror of the source repository. This implies --bare. Compared to --bare, --mirror not only maps local branches of the source to local branches of the target, it maps all refs (including remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update in the target repository.

enter image description here

ΦXocę 웃 Пepeúpa ツ
  • 43,054
  • 16
  • 58
  • 83