简体   繁体   中英

Github: Remote does not appear to be a git repository

I'm having some trouble with Github throwing the error: fatal: 'remote' does not appear to be a git repository.

I did the cloning, which was successful.

git clone https://github.com/StephenW789/CIS-41B-Final-Project-Public

cd CIS-41B-Final-Project-Public

git remote -v # Prints out the correct origin as expected

I then did this, which ended up having the error message

git fetch remote main
fatal: 'remote' 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.

I tried the following, but the issue still persists.

git remote remove origin
git remote add https://github.com/StephenW789/CIS-41B-Final-Project-Public
git fetch remote main

Thank you.

This is because remote is not the name of the remote: origin is the name of the remote. That is: instead of git fetch remote you want git fetch origin .

I, like Lasse V. Karlsen and yourself, missed this on the first few read-throughs. It's very easy to read "remote" as the correct name of the remote. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM