I met a weird bugs. For somereason, I need to get a library from ssh, instead of https:// And I think I set up the .gitconfig correct.
Here is my .gitconfig: [user] name = nickName email = email@email.com [difftool "sourcetree"] cmd = '' \"$LOCAL\" \"$REMOTE\" [mergetool "sourcetree"] cmd = "'' " trustExitCode = true [url "ssh://git@origin.url:7999/"] insteadOf = https://url/scm However, when I run go get url/lirbaryName It's throw me the error said can't get the library from www....., it looks that the go get still trying to download the library from https:// not ssh:. Here is the error message.
go: url/lirbaryName@versionnumber/go.mod: verifying module: url/lirbaryName@versionnumber/go.mod: reading https://sum.golang.org/lookup/url/lirbaryName@versionnumber: 410 Gone server response: not found: wurl/lirbaryName@versionnumber: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/7f429b03663193143b68514b6b1945024c80ec1d9b17c4afa862b0b8304a9db8: exit status 128: fatal: could not read Username for 'https://url': terminal prompts disabled Any idea for the bug? My go version is 1.15, and this library is not broken, my friend can go get successful with the same git config. By the way, I can git clone this library to the go/src folder, and run go build and go install, unfortunately, it's not working. still can't use this library in the go program.
let me know if you need more info. Thank you for the help.
https://stackoverflow.com/questions/66822420/the-git-config-of-setting-url-doesnt-work March 27, 2021 at 02:24AM
没有评论:
发表评论