Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab: How to git pull without credentials?

Tags:

gitlab

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 ?

like image 439
DevonDahon Avatar asked Apr 16 '26 16:04

DevonDahon


1 Answers

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 :)

like image 125
icedwater Avatar answered Apr 20 '26 01:04

icedwater