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
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
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.git
SSH
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
Alternatively, find .git/config
in the cloned folder structure, look for [remote "origin"]
, and edit the url =
assignment.
.git/config
would look similar to below,
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/USERNAME/REPOSITORY.git
Verify whether its working by examining the remotes:
git remote -v
# origin git://new.location (fetch)
# origin git://new.location (push)
Next time you push, mention the upstream like below:
git push -u origin master
Reference: GitHub: Manage Remote repositories