Skip to content

Instantly share code, notes, and snippets.

@sameei
Forked from dmitshur/gist:6927554
Created August 20, 2019 08:45
Show Gist options
  • Save sameei/1ec2f3f4a1e973c3fdae9da96fe39c57 to your computer and use it in GitHub Desktop.
Save sameei/1ec2f3f4a1e973c3fdae9da96fe39c57 to your computer and use it in GitHub Desktop.
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!

Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment