简体   繁体   中英

Create a New Github Repository from Existing Github Repository

I have a situation where I needed to create a new repository from the existing repository on Github (with different name) but I want to import the log/history as well from the old repository.

Is there a way to do this?

The use-case here is to separate a component from the existing repository by duplicating the repository and prune until we achieved the goal.

This is what that "fork" button (in the upper right of the screen when viewing a repository on GitHub) does. It will create a copy of the repository (which includes the entire history) with another name.

You can also:

  • git clone the existing repository to your local filesystem
  • Create a new empty repository on GitHub
  • Optionally add a new remote to your local repository pointing at the new GitHub repository ( git remote add ... )
  • git push your local repository to the new GitHub repository

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