Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git fork into an independent repository? [duplicate]

Tags:

git

github

I created a fork from some other users repository a long time ago. Then I made a lot of changes into my fork and re-wrote a lot of code.

Now I want to turn this fork into a repository on my account, as these two are really different I want to remove the relationship between the two. So that I can have issue tracking for this fork separately etc.

How can I do that ? I have tried looking around but did not find a good example.

like image 670
Sourabh Avatar asked Mar 29 '13 06:03

Sourabh


People also ask

Can you fork the same repository twice?

You are unable to fork a repo twice on Github (as of late 2021) but if you want to build on the same repo multiple times, you can use the "Import Repository" option and feed it the URL used to clone.

Is forking the same as cloning in GitHub?

The quick answer Forking creates your own copy of a repository in a remote location (for example, GitHub). Your own copy means that you will be able to contribute changes to your copy of the repository without affecting the original repository. Cloning makes a local copy of a repository, not your own copy.

Is forking a repo the same as cloning?

A fork creates a completely independent copy of Git repository. In contrast to a fork, a Git clone creates a linked copy that will continue to synchronize with the target repository.


1 Answers

Just add a remote to your new host and start pushing there.

git remote add newremote [email protected]/newrepo
git push -u newremote master //the -u will set this as the default

Clearly the whole commit history from the original repo will still be there.

Then, if you like, you can also remove the reference to the original remote (this does not make any difference, but it is surely cleaner)

git remote rm origin //or whatever the original remote is named
like image 133
Gabriele Petronella Avatar answered Sep 24 '22 15:09

Gabriele Petronella