Mostafa El-Zayat
Mostafa El-Zayat

Reputation: 51

Problems connecting vscode through SSH to gitlab

I am facing problem while trying to connect to GitLab remote repo through SSH here are the steps done so far:

I can't publish branches from VSCODE and getting the below error and I am using MAC.

Permission denied (publickey).
fatal: Could not read from remote repository.

Upvotes: 3

Views: 14593

Answers (2)

Safnas
Safnas

Reputation: 153

on Windows I faced similar issue. Was not able to checkout from Gitlab using open in VS Code option

For that, Just Open VS code using 'code' command in git bash. As per VS Code official documentation, doing so will inherit SSH environment. (from official VS Code docs)

I was facing issues when doing Gitlab -> clone -> open in your IDE -> VS code SSH.

opening VS code using a git bash solved the issue

Upvotes: 1

VonC
VonC

Reputation: 1323953

so when i am on gitlab website i am able to commit and publish branches

That has nothing to do with your local SSH key.

Test first on your local computer (Mac) if your key is working with:

ssh -Tv [email protected]

That will try and use your ~/.ssh/id_rsa private key, which means your ~/.ssh/id_rsa.pub public key must have been registered to your SSH profile GitLab account first.

Upvotes: 1

Related Questions