-
Notifications
You must be signed in to change notification settings - Fork 18k
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: get should fall back to the git protocol #18927
Comments
AFAIK, URL rewrite via a git config is working for others but we need a more reliable solution for this case. It is a large majority of the users who has to maintain private packages and URL rewrite config:
|
That's the workaround I use, but now I have to use a make file to ensure
Git is configured correctly on new machines like Travis. This makes the Go
tool useless out of the box, and one of the nice things about Go in my
opinion is that you don't need make to build code.
I think it should actually try SSH before HTTPS, but I'll take even SSH
being the fallback.
…On Mon, Feb 6, 2017 at 12:45 PM Jaana B. Dogan ***@***.***> wrote:
AFAIK, URL rewrite via a git config is working for others but we need a
more reliable solution for this case. It is a large majority of the users
who has to maintain private packages and go get doesn't support such a
common case out of the box.
URL rewrite config:
git config --global ***@***.***:".insteadOf "https://github.com/"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#18927 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD5VnYwxcgej6CDi-Ij5lxss_BWR50Hks5rZ4aCgaJpZM4L2vF5>
.
|
I feel this is more a documentation issue rather then a problem that needs solving, I'm perfectly happy using .netrc authentication for example: In the case of git there seem to be plenty more solutions (which I haven't tested): Go uses different VCS and so far as I know has chosen to use HTTP(S) as it's common transport protocol. For me it would make more sense to document how each VCS would be properly configured for authentication since in the end it should be the responsibility of the VCS to authenticate. Adding SSH as an extra transport protocol seems unnecessary complicated to combine with canonical imports and any other potential edge cases. |
It uses http/s because they're most commonly left open in firewalls (from the Go FAQ, if I recall correctly). SSH is yet another common transport that any VCS could use; how they use it, I shouldn't have to care about; it should work out of the box. If I have to configure a VCS to use SSH, then in general I have to know what VCS a package is hosted with before I try to import it. |
I think private Github repos work with HTTPS. The assertion above is that they only work over SSH. Can someone clarify? |
They work over HTTPS by provisioning a .netrc config for example. |
@rsc If private GitHub repos did work with HTTPS, then wouldn't the Go FAQ explain how to do that instead of how to do the Git URL rewrite configuration? |
Change https://golang.org/cl/107775 mentions this issue: |
I sent out a doc update in response to the comment above, and then we'll call this fixed. golang.org/cl/107775. |
go get
doesn't work for private GitHub repos because it only tries HTTPS (or HTTP if you use -insecure IIUC). Why not have a fallback for HTTPS that tries SSH as well?The text was updated successfully, but these errors were encountered: