I want to remove the wrong repository and replace it with the correct repository on GitHub. What do I do?
Fatal: repository "https://GitHub.com/username/alx-pre_school.git" not found
On
Most likely you have named your repository origin, you can check it by running
git remote -v
The output will look like
origin https://github.com/user/your_repo.git (fetch)
origin https://github.com/user/your_repo.git (push)
To change the remote's repository URL run
git remote set-url origin https://github.com/user/new_name.git
You could simply execute the following command to change the URI:
HTTPS
git remote set-url origin https://github.com/USERNAME/REPOSITORY.gitSSH
git remote set-url origin [email protected]:USERNAME/REPOSITORY.gitAlternatively, find
.git/configin the cloned folder structure, look for[remote "origin"], and edit theurl =assignment..git/configwould look similar to below,Verify whether its working by examining the remotes:
Next time you push, mention the upstream like below:
Reference: GitHub: Manage Remote repositories