Skip to content
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 get" should look locally for git config rules #19127

Closed
ajzaff opened this issue Feb 16, 2017 · 0 comments
Closed

cmd/go: "Go get" should look locally for git config rules #19127

ajzaff opened this issue Feb 16, 2017 · 0 comments

Comments

@ajzaff
Copy link

ajzaff commented Feb 16, 2017

Using Golang 1.7.5

Background: go get will fail for private repos which require a username and password to pull. One workaround is adding some configuration in ~/.gitconfig:

[url "ssh://git@github.PRIVATE.com/"]
    insteadOf = https://github.PRIVATE.com/

or:

[url "https://${TOKEN}:x-oauth-basic@github.PRIVATE.com/"]
    insteadOf = https://github.PRIVATE.com/

This is nice. However, go get will ignore the same local setting in ./.git/config in the currect directory.

Story: As a CLI user under Git, I should be able to define --local rules for geting private packages from Github

To duplicate this issue:

  1. configure an ssh private key with read access to the private repo
  2. go get github.PRIVATE.com/MY/REPO, expect fail
  3. git config --local url."ssh://git@github.PRIVATE.com/".insteadOf "https://github.PRIVATE.com/"
  4. go get github.PRIVATE.com/MY/REPO, expect fail
  5. git config --global url."ssh://git@github.PRIVATE.com/".insteadOf "https://github.PRIVATE.com/"
  6. go get github.PRIVATE.com/MY/REPO, expect to work
@ALTree ALTree changed the title "Go get" should look locally for git config rules cmd/go: "Go get" should look locally for git config rules Feb 17, 2017
@ajzaff ajzaff closed this as completed Feb 21, 2017
@golang golang locked and limited conversation to collaborators Feb 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants