DevonDahon
DevonDahon

Reputation: 8350

Gitlab: How to git pull without credentials?

I have generated an id_ed25519 key on my server and set it in Gitlab, when I try to connect with SSH, I get the welcome message, but when using git pull, it's still requiring credentials (username and password).

$ ssh -T [email protected]
Welcome to GitLab, @john.doe!
$ git pull
Username for 'https://gitlab.com': john.doe
Password for 'https://[email protected]': 
Already up to date.

What's missing in my configuration ?

Upvotes: 3

Views: 4886

Answers (2)

icedwater
icedwater

Reputation: 4887

Please check your configured remote, it should be the https one:

$ git remote -v
origin https://gitlab.com/john.doe/myproject.git (fetch)
origin https://gitlab.com/john.doe/myproject.git (push)

You'll want to change it to the SSH one:

$ git remote set-url origin [email protected]:john.doe/myproject.git

This does what OP mentioned in the comment of the accepted answer, without having to manually edit the config file. Please upvote the accepted answer before mine :)

Upvotes: 5

Shankar
Shankar

Reputation: 360

I guess it would be because you are using https git remote url instead of ssh one.

Upvotes: 4

Related Questions