Git - Remote: Repository Not Found
I Have Sourcetree with Local Working Copy. and All Operations Work Good, I Can Simple Fetch, Push, Pull and Etc via Sourcetree. I Just Needed to Make Force...
I have SourceTree with local working copy. And all operations work good, I can simple fetch, push, pull and etc via SourceTree. I just needed to make force push which does not exist in SourceTree.
I opened terminal made git push -f
remote: Repository not found.
fatal: repository ' not found
I am not sure what can be an issue.
52 Answers
Remove all the github.com credential details from the system.
For mac
Delete the github.com password from the Keychain Access.
For windows
Delete the credentials from Credential Manager.
Please find below the working solution for Windows:
- Open Control Panel from the Start menu.
- Select User Accounts.
- Select the "Credential Manager".
- Click on "Manage Windows Credentials".
- Delete any credentials related to Git or GitHub.
- Once you deleted all then try to clone again.
I was also facing the same issue
remote: Repository not found
fatal: repository ' not found
I uninstalled the git credentials manager and reinstalled it and then I could easily pull and push to the repository. Here are the commands
$ git credential-manager uninstall
$ git credential-manager install
This message can occur when a repository IS found, but we don't have commit access. Not well-worded!
I received the repo-not-found message after cloning a gitHub repository created for me by my boss. I could clone and commit locally, but could not push commits upstream. The repository owner had not given me write access. Solved by a plea for write access to the repo owner.
Because you probably did not identify the remote git repository to your terminal first.
git remote set-url origin
and then,
git add .
git commit -m "initial commit"
git push origin master
This issue here is you local git is not able to push the changes to the remote Check your remote is set correctly by
git remote -v
if it is not set properly try setting your remote as
git remote set-url origin
Then try pushing using
git push -u origin master
Also there is a possibility of your local git has different credentials, please check that also.
On Windows:
- Go to .git folder
- Open 'config' file using notepad or any other editor
- Change your URL from to
Save and Push the code, it will work.
On Mac
If you are trying to clone the repo.... Then this problem is may occur because you don't have repo present in the github account present in Keychain Access. For resolution try to clone with the account name like
git clone
Replace
- username with your GitHub username
- org with yours organisation name
- repo with repository name
Must Read
Add "Personal Access Token"
Since since 2021 Github supports PAT rather than name/password (read here how to create and use one) so we just add it into the remote origin.
On Windows
- Visit
.gitfolder and openconfigfile for editing. Eg.vim config. - Change your URL from
to
Where[personal-access-token]is the PAT hash you've created at github. - Save the
configfile and now the push should work.
Shortcut:
git remote remove origin
git remote add origin