git报错:‘origin‘does not appear to be a git repository的解决方法
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                git报错:‘origin‘does not appear to be a git repository的解决方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                文章目錄
- #事故現場
- #解決方法
 
 
#事故現場
git push origin master時報錯:
fatal: 'origin' does not appear to be a git repository#解決方法
使用git remote -v命令,什么都沒有輸出;
 說明和遠程已失去聯系,這種情況可能是遠程倉庫已改名,或者是git remote add時操作沒有將相關配置加上(或者有異常);
 第一種可能可以排除,那就是第二種可能了。
和其他git項目對比了一下.git/config文件,發現了問題所在,這個git倉庫只有[core]節點,沒有[remote “origin”]和[branch “master”]節點信息。
[core]repositoryformatversion = 0filemode = truebare = falselogallrefupdates = true也就是說當你git push origin master的時候,git需要去config中查找你提交的分支信息,但是config中又是空的,所以返回上述錯誤。
 所以解決方法就是把信息直接填上:
總結
以上是生活随笔為你收集整理的git报错:‘origin‘does not appear to be a git repository的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 【架构师修炼之路】Redis 极简教程
- 下一篇: 达摩院开放AI能力宝塔,万般法器助力新时
