按照github的如下命令提示创建本地项目结果提示错误:
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:oneweekonething/test.git
git push -u origin master
错误信息:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法:
第一步:在github上创建一个和本地一样的项目名字,记得不要添加REAME.MD文件。
第二步:设置远程仓库url git remote set-url origin git@github.com:oneweekonething/test.git
然后就可以了。
本文介绍了一种常见GitHub推送错误的解决方法,当遇到'fatal: Could not read from remote repository'时,首先确保在线仓库存在且权限正确,接着通过设置远程仓库URL来完成本地项目的首次推送。
1万+

被折叠的 条评论
为什么被折叠?



