13

I have a git repo on a remote server and use ssh with password authentication to clone,pull,push. From command line everything works fine.

However in vscode when I try to pull or push from remote repository, no password prompt is shown. Vscode seems to be waiting for something but nothing happens. Is this a bug, or am I doing something wrong?

I want to use visual studio code as git client on linux.

From command line:

enter image description here

In vscode:

enter image description here

mihca
  • 997
  • 1
  • 10
  • 29

3 Answers3

5

There are two solutions I can think of:

  • Set up an SSH key so that you never need credentials for accessing the server the remote repository is on
  • Tell git to remember credentials when you type them in - this answer tells you how

EDIT:

Here is a quick recipe how to set up an SSH key for your git repo:

On the client side (where you cloned the repository)

  • Check if you have an ssh key in ~/.ssh
  • If not, generate an SSH key without passphrase using ssh-keygen (mine is called id_rsa)
  • add this key to the authentication agent using ssh-add ~/.ssh/id_rsa

On the remote side (where the repo is hosted)

  • create the file ~/.ssh/authorized_keys
  • into this file copy and past your public key, which you just created on the client side (mine is saved in ~/.ssh/id_rsa.pub)

Afterwards try a git pull on the client side. It should not ask for a password anymore and pull/push from vscode should work as well

mihca
  • 997
  • 1
  • 10
  • 29
hitecherik
  • 442
  • 2
  • 13
  • 3
    So I guess plain password authentication is just not supported by vscode then. Feels like a basic feature missing – mihca Jun 20 '18 at 17:26
  • Yeah, it's a shame. This seems like it would be a relatively common problem, though, so I'm surprised it isn't included... – hitecherik Jun 21 '18 at 23:08
1

It's strange but, this is also caused if your VSCode has the GitlabFlow extension enabled. When uninstalled, the credentials prompt came back again.

arkantos
  • 497
  • 3
  • 14
0

VSCode (1.25) does show password input prompt on Git https clone (if required) or push.

That is the feature is available. Not sure if your problem is ssh related, in which case it may be a bug, you may log on the VSCode issue-tracker.

  • The lack of SSH passphrase support has been raised as VS Code issue [#13680](https://github.com/Microsoft/vscode/issues/13680). – Simon Brady Jan 13 '19 at 21:09