forging2012
8/14/2019 - 3:19 PM

How to `go get` private repos using SSH key auth instead of password auth.

How to go get private repos using SSH key auth instead of password auth.

$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
    insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!

Sources: