3

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

4
  • Did you add the ssh key for that user to your gitlab account? I am using private repos without any problems with that key set. Commented Oct 2, 2019 at 14:16
  • @bserdar: Post says he did... Commented Oct 2, 2019 at 14:17
  • @Flimzy Post says he generated a key. Is that the ssh key? Commented Oct 2, 2019 at 14:19
  • @bserdar yes, I added the ssh pub key. If I use "git clone" it prompts me for the username and so I can pass username and password of the gitlab user. Commented Oct 2, 2019 at 14:21

2 Answers 2

1

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/"
Sign up to request clarification or add additional context in comments.

6 Comments

it says this: # cd .; git ls-remote https://<machine>/<path> ssh: Could not resolve hostname http: Temporary failure in name resolution fatal: Could not read from remote repository.
@gianpaolo usually it says if you're add wrong ssh-key github.com/jakubroztocil/cloudtunes/issues/23
@gianpaolo I updated the answer 12mins ago. Maybe you're trying not a final version of answer
I added a new ssh-key, nothing changed :(
yes, I used yr edited method. same errors and prompts to enter the password of the user of the local machine (the one where I run the command)
|
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.