简体   繁体   中英

Using public git repositories on private git server

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.

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.

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