跳转到内容

如何复制一个git仓库

有时候,我们需要复制Github一个仓库到自己、公司的私有库,类似Fork的功能。

  1. bare clone一个仓库
Terminal window
git clone --bare https://github.com/exampleuser/old-repository.git
  1. mirror push到新仓库
Terminal window
git push --mirror https://github.com/exampleuser/new-repository.git