Creating an official github mirror

后端 未结 4 1417
野的像风
野的像风 2020-12-04 06:17

How do I create a github mirror for an external git repository, such that it appears as \"real mirror\", e.g., as in https://github.com/mirrors?

So far, I set up a m

4条回答
  •  一向
    一向 (楼主)
    2020-12-04 06:44

    According to Importing a Git:

    For purposes of demonstration, we'll use:

    • An external account named extuser
    • A GitHub personal user account named ghuser
    • A GitHub repository named repo.git

    The command line:

    # Makes a bare clone of the external repository in a local directory  
    $ git clone --bare https://githost.org/extuser/repo.git
    
    # Pushes the mirror to the new GitHub repository
    $ cd *repo.git*
    $ git push --mirror https://github.com/ghuser/repo.git
    
    # Remove the temporary local repository.
    $ cd ..
    $ rm -rf repo.git
    

提交回复
热议问题