Skip to content

Instantly share code, notes, and snippets.

@tcelestino
Created February 6, 2020 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcelestino/fb05063f28a8445b482235c684fbcc71 to your computer and use it in GitHub Desktop.
Save tcelestino/fb05063f28a8445b482235c684fbcc71 to your computer and use it in GitHub Desktop.

Mirroring a repository

Open Terminal.

Create a bare clone of the repository.

$ git clone --bare https://github.com/exampleuser/old-repository.git

Mirror-push to the new repository.

$ cd old-repository.git
$ git push --mirror https://github.com/exampleuser/new-repository.git

Remove the temporary local repository you created in step 1.

$ cd ..
$ rm -rf old-repository.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment