Skip to content

/errors/git/origin-does-not-appear-to-be-a-git-repository

fatal: 'origin' does not appear to be a git repository

verified onenvironmentlocal · linux 6.18.44-fc-v140 x64 · GNU bash 5.2.21 · git version 2.43.0updated
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:

bash
git init -q repo
cd repo
git remote -v
git fetch origin

Output · 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

bash
git init -q repo
cd repo
git remote add origin https://example.com/team/project.git
git remote -v

Output

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:

bash
git init -q repo
cd repo
git remote add origin ../missing-repo
git fetch origin

Output · 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.

Sources