Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change project repository using git

Tags:

git

I have a project I work on. Lets call it foo. This project is in repository in github called foo repository.

I want to switch the project to another repository called better foo. I don't want to delete the existing repository. I want to make another one so all my changes appear on the other repository and the current one stays as it is.

The reason is that I have to work on two projects. The one is small and the second one is something like an upgrade on the first one with some changes. What I want is to make the first one, leave it be and change the directory of the project so that when I make changes they will appear on the second repository while the first one stays the same.

like image 703
Pavlin Petkov Avatar asked Aug 31 '26 01:08

Pavlin Petkov


1 Answers

You can update the remote url to the new repository:

git remote set-url origin git://new.repo.url

This will leave your existing repository and any changes made will reflect in the new repository.

like image 61
ザヘド Avatar answered Sep 02 '26 00:09

ザヘド



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!