Skip to content

Instantly share code, notes, and snippets.

@jalamprea
Forked from dmitshur/gist:6927554
Last active March 18, 2020 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalamprea/6de11a2fe6b8a691c9fe5c8f54d2cf0c to your computer and use it in GitHub Desktop.
Save jalamprea/6de11a2fe6b8a691c9fe5c8f54d2cf0c to your computer and use it in GitHub Desktop.
How to `go get` private repos using SSH key auth instead of password auth.
$ 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:

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