'origin' does not appear to be a git repository fatal: Could not read from remote repository.
时间: 2023-08-21 09:18:34 浏览: 235
码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository. P
5星 · 资源好评率100%
这个错误通常是由于git仓库的配置问题引起的。根据引用\[1\]和引用\[2\]的信息,可以看出问题出在.git/config文件中缺少了\[remote "origin"\]和\[branch "master"\]节点的信息。这导致在执行git push origin master命令时无法找到远程仓库的信息,从而报错。解决这个问题的方法是在.git/config文件中添加正确的配置信息,如引用\[3\]所示。你可以手动将以下内容添加到.git/config文件中:
\[core\]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
\[remote "origin"\]
url = http://192.168.1.183/git/RCTools.git
fetch = +refs/heads/*:refs/remotes/origin/*
\[branch "master"\]
remote = origin
merge = refs/heads/master
添加完毕后,保存文件并重新执行git push origin master命令,应该就能成功推送到远程仓库了。
#### 引用[.reference_title]
- *1* [git-报错总结-fatal: 'origin' does not appear to be a git repository...](https://blog.csdn.net/vv___/article/details/105744407)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [git报错:‘origin‘does not appear to be a git repository的解决方法](https://blog.csdn.net/willingtolove/article/details/113187468)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文