Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

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:

  • git clone BASE_GITHUB_URL NEW_DIR
  • cd /NEW_DIR

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.

like image 445
Johannes Tyra Avatar asked Sep 05 '11 10:09

Johannes Tyra


1 Answers

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.

like image 97
Arnaud Le Blanc Avatar answered Nov 03 '22 01:11

Arnaud Le Blanc