How to upload a project to a repository different from the one that was cloned?


I have a project to clone from a git repository, now I want to upload it to my github account to work it from there, the question is: how do I upload it to a new git server? I tried to add it but it always redirects me to the old server

asked by noe 16.12.2017 в 02:42

3 answers


First delete the .git directory:

rm -rf .git

Then initialize a new repository:

git init
git add .
git commit -m 'mensaje a enviar'
git push URL /*del repositorio donde va ha enviar; para mi caso era uno de GitHub*/
answered by 08.02.2018 / 18:00

Removing the remote from the cloned repository should be enough.


git remote remove origin

For clients with git 1.7.10 and earlier:

git remote rm origin

And then you add the new remote:

git remote add origin

You can also avoid having to delete and add by simply changing the URL of the remote:

git remote set-url origin

Then you execute the traditional steps to make push your changes and see them in the new remote.

Although it is always good to fork the repository.

Taken from here

And you should be fine.

answered by 05.01.2018 в 22:25

Suppose you cloned jQuery:

git clone

Then on github create your own repo and stayed in

In your place you have to change the remote to point to your repo:

git remote --set-url origin

And from then on when you do push you'll be working with your repo

answered by 19.12.2017 в 13:37