Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • Successfully generated SSH keys
  • Administration added the keys to the repo, so when I am on GitLab website, I am able to commit and publish branches

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.
like image 308
Mostafa El-Zayat Avatar asked May 20 '26 18:05

Mostafa El-Zayat


1 Answers

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.

like image 134
VonC Avatar answered May 22 '26 06:05

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!