-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go mod tidy
not using .git/config
settings
#65041
Comments
go mod tidy
not using .git/config
settingsgo mod tidy
not using .git/config
settings
The fact that the local However, the need for this |
insteadOf might be there for auth reasons? |
Looking at the code, I think the In contrast, by default GitLab requires the specific user |
More a work around than anything, but I have this exact configuration in
And it works perfectly with |
@Jorropo, I'm curious: does it still work if you use (My hypothesis is that it does, and if so I think the |
@bcmills it does not: > GOPRIVATE=github.com go get github.com/ipfs/$REPO@latest
go: github.com/ipfs/$REPO@latest: module github.com/ipfs/$REPO: git ls-remote -q origin in /home/hugo/go/pkg/mod/cache/vcs/1572f4aa1ba63bc6815a9b2d64ca8e071b19e19f33e22b6a95cf4bf0efb40471: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
> cat ~/.gitconfig
# ...
[url "ssh://git@github.com/"]
insteadOf = ssh://github.com/
# ...
> nano ~/.gitconfig # put it back to insteadOf = https://github.com/
> GOPRIVATE=github.com go get github.com/ipfs/$REPO@latest # works
go: downloading github.com/ipfs/$REPO v0.2.20 |
Hi! Problem is actual, i tried to solve problem like this, but it doesn't help |
no secure protocol found for repository |
I reproduced this issue with This seems a bit unexpected. While it is reasonable that /module # go mod download 2>&1 | head -3
go: my.private/repo@v1.2.3: reading my.private/repo/go.mod at revision v1.2.3: git ls-remote -q origin in /go/pkg/mod/cache/vcs/xxxxxx: exit status 128:
Host key verification failed.
fatal: Could not read from remote repository.
/module # GIT_SSH_COMMAND=$(git config core.sshcommand) go mod download
(successful) |
Go version
go version go1.21.5 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
In workspace's
.git/config
:Then
go mod tidy
.What did you see happen?
go mod tidy
emits lots ofno secure protocol found for repository
errors:What did you expect to see?
No errors.
After moving the
url
setting from.git/config
to~/.gitconfig
,go mod tidy
works as expected.The text was updated successfully, but these errors were encountered: