英文:
Invalid version: git ls-remote -q origin
问题
go mod download
报错信息如下:
无效的版本:git ls-remote -q origin in /home/user/go/pkg/mod/cache/vcs/48782783hhh8394928: 退出状态 128:
远程:支持密码身份验证已于 2021 年 8 月 13 日移除。
远程:请参阅 https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls 了解当前推荐的身份验证模式的信息。
致命:身份验证失败 for 'https://github.com/***/***/'
GO 版本信息如下:
GO 版本:1.20
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/user/go/pkg/mod"
GONOPROXY="github.com/name/*"
GONOSUMDB="github.com/name/*"
GOOS="linux"
GOPATH="/home/user/go"
GOPRIVATE="github.com/name/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build909459645=/tmp/go-build -gno-record-gcc-switches"
需要帮助吗?
英文:
go mod download
giving:
invalid version: git ls-remote -q origin in /home/user/go/pkg/mod/cache/vcs/48782783hhh8394928: exit status 128:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/***/***/'
GO version: 1.20
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/user/go/pkg/mod"
GONOPROXY="github.com/name/*"
GONOSUMDB="github.com/name/*"
GOOS="linux"
GOPATH="/home/user/go"
GOPRIVATE="github.com/name/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build909459645=/tmp/go-build -gno-record-gcc-switches"
Any help?
答案1
得分: 0
修改了 ~/.gitconfig
文件。
修改前:
insteadOf = https://github.com
修改后:
insteadOf = https://github.com/orgName
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论