I have a repo called react
.
I cloned it into a different repo locally called different-repo
.
How can I then get different-repo
to push remotely to different-repo because currently it is pushing to react
.
Effectively I want to clone many times from react
into different named repos but then when i push from those repos they push to their own repo.
Best Answer
You have to add an other
remote
. Usually, you have anorigin
remotes, which points to the github (maybe bitbucket) repository you cloned it from. Here's a few example of what it is:https://github.com/some-user/some-repo
(the.git
is optional)[email protected]:some-user/some-repo
(this is ssh, it allows you to push/pull without having to type your ids every single time)C:/some/folder/on/your/computer
Yes! You can push to an other directory on your own computer.So, when you
origin
is replaced with it's value: the urlSo, it's basically just a shortcut. You could type the url yourself each time, it'd do the same!
Note: you can list all your
remote
s by doinggit remote -v
.For your problem
I'm guessing you want to create a second repository, right? Well, you can create an other
remote
(or replace the currentorigin
) with the url to this repo!Add an other
remote
— recommendedSo, for example:
And then, just
Change the
origin
remote
So