Skip to content

Instantly share code, notes, and snippets.

@v0lkan
Last active September 5, 2022 03:46
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 v0lkan/92f6affeebd65da752a3c396fa6b267b to your computer and use it in GitHub Desktop.
Save v0lkan/92f6affeebd65da752a3c396fa6b267b to your computer and use it in GitHub Desktop.
How to Import Private Go Repositories

Have this in your ~/.gitconfig:

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

Make sure you have these environment variables set:

# ~/.profile
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin

# OpsBeacon
export PATH=$PATH:/usr/local/go/bin
export GO_INSTALL_DIR=/usr/local/go
export GOROOT=$GO_INSTALL_DIR
export GOPATH=$HOME/go
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
export GO111MODULE="on"
export GOSUMDB=off
# All GitHub users and orgs that have private repos that you need go here:
export GOPRIVATE="github.com/zerotohero-dev,github.com/v0lkan"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment