/errors/git/origin-does-not-appear-to-be-a-git-repository
fatal: 'origin' does not appear to be a git repository
- tool
- Git
- exit code
- 128
- versions
- Git 2.x
- os
- any
fatal: 'origin' does not appear to be a git repository means Git cannot use the remote called origin. Either no remote with that name exists, or its URL does not lead to a repository. Run git remote -v. If nothing is listed, add the remote with git remote add origin URL.
Reproduce it
A repository made with git init has no remotes:
git init -q repo
cd repo
git remote -v
git fetch originOutput · exit 128
fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
A git push origin main fails the same way. The message continues with fatal: Could not read from remote repository. and a hint about access rights.
Add the remote
git init -q repo
cd repo
git remote add origin https://example.com/team/project.git
git remote -vOutput
origin https://example.com/team/project.git (fetch) origin https://example.com/team/project.git (push)
If the command answers error: remote origin already exists, the remote is there already: see remote origin already exists. Change its URL with git remote set-url origin NEW_URL.
The URL is wrong
When the name exists but the path does not, Git reports the path it tried:
git init -q repo
cd repo
git remote add origin ../missing-repo
git fetch originOutput · exit 128
fatal: '../missing-repo' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Check for typos, a moved or renamed repository, and a missing .git suffix on local paths. For hosted remotes, confirm the owner and repository name in the web interface.
Check the whole configuration
git config --get-regexp '^remote\.' prints every remote and refspec, which also shows remotes defined in a global or included config file.