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
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
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*/
Removing the remote from the cloned repository should be enough.
Do:
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 https://tunuevoremote.com/repo.git
You can also avoid having to delete and add by simply changing the URL of the remote:
git remote set-url origin https://tunuevoremote.com/repo.git
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.
Suppose you cloned jQuery:
git clone https://github.com/jquery/jquery.git
Then on github create your own repo and stayed in
https://github.com/noe/jquery_reloaded
In your place you have to change the remote to point to your repo:
git remote --set-url origin https://github.com/noe/jquery_reloaded.git
And from then on when you do push
you'll be working with your repo