SSH - Git still ask for my username and password

By xngo on May 19, 2020

I setup everything to use SSH key to connect to my Gitlab repository. I tested with ssh -T and it is showing the welcome message. But it is still asking for my username and password when I run the following command.

git pull
Username for '':


Notice the https part of the result from the command above. Well, my current repository is still using HTTPS. I have to switch it to use SSH. I ran the following command.

git remote set-url origin

Clone git repository: SSH or HTTPS

About the author

Xuan Ngo is the founder of He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.