栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

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

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

1. Go编译报错信息

E:workhqsourcestockquote_sh_l2_parser>go build
go: xxxxxxx/yyyyyyyy/quote_lib@v0.3.115-0.20220302053425-232076327f09: invalid version: git ls-remote -q origin in C:Gorepositorypkgmodcachevcs87198654213a7c861ce67251dbddf3f94fb383755ea8e89812eb7f12fc9c666e: exit status 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.

go编译时,git需要拉取对应的依赖库,拉取依赖库时,会先去GOPATH路径下的缓存去查找,如果缓存不正确,就有可能导致莫名其妙的问题。上面问题关键在这里

invalid version: git ls-remote -q origin in C:Gorepositorypkgmodcachevcs87198654213a7c861ce67251dbddf3f94fb383755ea8e89812eb7f12fc9c666e

2. 解决方案

 删除go同步依赖库的缓存,很多时候可能由于缓存有问题,造成了莫名其妙的错误,就类似于Java项目的maven时,依赖库没有正确下载,后续因为缓存库引入有问题,需要重新清理一下缓存才能正确编译和使用。

现在我们找到上面的文件夹,然后删除此文件夹。文件的路劲根据提示自己确认。我的需要删除的文件夹如下:

C:Gorepositorypkgmodcachevcs87198654213a7c861ce67251dbddf3f94fb383755ea8e89812eb7f12fc9c666e

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/971076.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号