-1

We are working on a project that uses a repository SomeRepo on Github. Our project is hosted on private git server, let's call it myhub. We want to make a copy of SomeRepo from Github to myhub. We also want an ability to update our copy on myhub frequently from Github. I read quite a few different answers involving --mirror and --bare but they all look different and so I'm doubtful about best way of doing this. I even saw an answer that doesn't mention using these flags at all.

What is the best way to achieve this? Some reasoning of options used in command would be great as well.

Shital Shah
  • 63,284
  • 17
  • 238
  • 185
  • Possible duplicate of [GitHub: How to make a fork of public repository private?](http://stackoverflow.com/questions/10065526/github-how-to-make-a-fork-of-public-repository-private) – Shital Shah Apr 21 '16 at 21:37
  • I've found the answer here: http://stackoverflow.com/a/30352360/207661 so marking my question as duplicate and voting for close. – Shital Shah Apr 21 '16 at 21:38

1 Answers1

0

You can use either --bare or its superset --mirror. For an explanation of the difference between them, see here: What's the difference between git clone --mirror and git clone --bare

The reason to use one of these options is that your server probably doesn't need a working copy of all the files. It'd just be a waste of space and I/O to maintain them.

Community
  • 1
  • 1
John Zwinck
  • 239,568
  • 38
  • 324
  • 436