Johannes Tyra
Johannes Tyra

Reputation: 113

Whats the best way to clone / duplicate a project into a new with git?

I want to clone an existing git repo for a NEW project. After the cloning the code should be developed independent from the original. I want to host the NEW project on GITHUB too.

My Workflow:

But after that my 'clone' is connected with the base repo on Github. I want to push the changes into a NEW Github Repo instad

I new its simular like 'fork', but it doesn't work with me as same the user on Github.

Upvotes: 11

Views: 13023

Answers (1)

Arnaud Le Blanc
Arnaud Le Blanc

Reputation: 99919

Remove the reference to the original repository:

git remote rm origin

Add a reference to your own repository:

git remote add origin your-repos-url

You may want to only rename the original repository instead of removing it:

git remote rename origin upstream

See git help remote for more informations.

Upvotes: 20

Related Questions