Change Origin of a git repository

If you want to change the URL of a repository to which it points to, then this post is for you. If you try the same command:

git remote add origin

then it is not gonna work and you will probably get error like this:

fatal: remote origin already exists.

List your existing remotes in order to get the name of the remote you want to change

git remote -v

Change your repository’s remote url with command:

git remote set-url origin

Substitute the values of USERNAME and OTHERREPOSITORY with yours.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close