The Go Blog

Go use private repository

Bantana
21 June 2019

use ~/.gitconfig

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

Use this command added to ~/.gitconfig

git config --global url."ssh://git@github.com".insteadOf "https://github.com"

git config --global url."ssh://git@iohttps.com".insteadOf "https://iohttps.com"

git config --global url."ssh://git@radevio.com".insteadOf "https://radevio.com"

reference

if you want used in docker CI & CD:

see .netrc with ~/.git-credentials

Related articles