Link a local repository to a different remote repository
1- Delete all connection with the remote repository:Inside the project folder:
git rm .git
(Remove all data from local repository)git status
(I must say that it is not linked to any, something like an error)
2- Link to a new remote repository
git init
To start a local repositorygit remote add origin urlrepository.git
To link with remote repositorygit remote -v
To confirm that it is linked to the remote repository
3- Add changes to the local repository and push to the remote repository
git pull
orgit pull origin master --allow-unrelated-histories
if git history is different in both local and remote repo.git add.
git commit -m" Message "
git push -u origin master
that's it!