Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fahmifan
Last active June 26, 2022 00:34
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 fahmifan/9d224d88d65d946a8958c9851748fc25 to your computer and use it in GitHub Desktop.
Save fahmifan/9d224d88d65d946a8958c9851748fc25 to your computer and use it in GitHub Desktop.
Setup for Accessing Go Private Repository
# add your ssh public key to github & gitlab
# set GOPRIVATE, for github & gitlab
GOPRIVATE="gitlab.com/<your-private-group>,github.com/<your-private-group>"
# if you use a private hosted gitlab
GOPRIVATE="gitlab.yoursite.com"
# set github to use ssh
git config --global url."git@github.com:".insteadOf "https://github.com/"
# set gitlab to use ssh
git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/"
# if you use a private hosted gitlab
git config --global url."git@gitlab.yoursite.com:"insteadOf "https://gitlab.yoursite.com/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment