petehallw petehallw - 1 year ago 90
Git Question

Git asking for git@git.repo.local password

I'm trying to clone or push to an empty repository on our Gitlab server using SSH authentication but whenever I try I am asked for the git password (using Git Bash):

myname@PC0016 MINGW64 /c/users/myname/dev
$ git clone git@git.repo.local:android/myApp.git
Cloning into 'myApp'...
git@git.repo.local's password:

I have tried my password and the Git password given to me by an admin but I get:

Please make sure you have the correct access rights
and the repository exists.

Why do I need to supply this password when I have added my SSH key to the project file in Gitlab? What am I missing? Thanks!

Answer Source

Create a ssh_config`, where you will point your client to your identity file:

Host git.repo.local
  IdentityFile C:\Users\myname\.ssh\id_rsa

Also store this file in the /z/.ssh/config to be read by your client.