I am unable to "go get" module from private github repo
I getting following error message
go get
go: github.com/xxxxx/xxxxx-service@v0.0.0-20230419012042-5a43328285a5: invalid version: git ls-remote -q origin in /usr/local/bin/pkg/mod/cache/vcs/e3eb4c4c224c608f41c609b576ad32d5a979877e8a7f951b716f1242957c7ddd: exit status 128:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/xxxxx/xxxxx-service/
I tried with the following method. Added the the github credentials in ~/.netrc
:
machine github.com
login <username>
password <Personal Access Token>`
Added the following entries in ~/.gitconfig
file
[url "git@github.com:"]
insteadOf = https://github.com/
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
Added the environment variable
export GOPRIVATE=github.com/<username>/*
export GO111MODULE=on
Still getting the same Authentication error.