Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

go get with private gitlab repo

Tags:

git

go

gitlab

Despite all the attempts I can't succeed in using "go get" to get a private repo from gitlab I've tried with .netrc, gitconfig but it doesnt work. I have a private machine with git on it, suppose it is mymachine.prv

git config --global url."[email protected]:".insteadOf "https://mymachine.prv/"

I run this command from a virtual machine with user "gp" and it keeps asking me the password for [email protected]

So I have generated the public key with ssh-keygen and added to gitlab account, but no luck.

Any help please?

Gianpaolo

like image 846
gianpaolo Avatar asked Nov 22 '25 04:11

gianpaolo


2 Answers

I guess it should helps you. You miss the ssh://

Post for example how it works: https://www.scivision.dev/git-pull-https-push-ssh/

git config --global url."ssh://[email protected]/".insteadOf "https://mymachine.prv/"
like image 148
frankegoesdown Avatar answered Nov 23 '25 21:11

frankegoesdown


When using Personal access token for .netrc approach, ensure that the project/repo is in a group that you have access to. Also, the scope of the PAT should have read_api, and read_repository.

like image 21
Junaid Avatar answered Nov 23 '25 22:11

Junaid