Problems connecting vscode through SSH to gitlab

Viewed 6116

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.
2 Answers

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

Related