You have one thing to configure. The example is based on GitHub but this shouldn't change the process:
$ git config --global [email protected]:.insteadOf https://github.com/
$ cat ~/.gitconfig
[url "[email protected]:"]
insteadOf = https://github.com/
$ go get github.com/private/repo
For Go modules to work (with Go 1.11 or newer), you'll also need to set the GOPRIVATE
variable, to avoid using the public servers to fetch the code:
export GOPRIVATE=github.com/private/repo