petehallw
petehallw

Reputation: 1014

Git asking for [email protected] 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 [email protected]:android/myApp.git
Cloning into 'myApp'...
[email protected]'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!

Upvotes: 1

Views: 1340

Answers (2)

acornagl
acornagl

Reputation: 521

You need an ssh key to skip the authentication phase. Usually the operation that I perform are:

  1. Generate an ssh key if you don't have already one: instructions,
  2. Add the key to gitlab: page,
  3. Clone the repository via ssh: Clone or downloading button in the project main page,
  4. Set the username or the email address for the commit messages: instructions,
  5. Have fun!!!

If you properly set the key everything will be fine.

Upvotes: 0

Jakuje
Jakuje

Reputation: 25946

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.

Upvotes: 1

Related Questions