Can't push without user/password. ssh test works fine

,

I saw an older post with the same issue, but didn’t see the solution. Below you can see I can do the ssh test fine, but the moment I push it goes to user/password. I just added the config, but I’m not sure why it would be needed, as it has no problems with the test without it.

larry@/home/larry/git/configs%ssh -T git@gitlab.com
Welcome to GitLab, @larrys!
[3630 22-09-14 12:17]larry@/home/larry/git/configs%git push
Username for 'https://gitlab.com': ^C
larry@/home/larry/git/configs%ls ~/.ssh/
config  heroku  heroku.pub  id_ed25519  id_ed25519.pub  known_hosts
larry@/home/larry/git/configs%cat ~/.ssh/config
# gitlab account
Host <larrys.gitlab.com>
  Hostname gitlab.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_ed25519

For that repo git is configured to use https (you can see the prompt for username mentions that), so it doesn’t really matter that ssh works.

I’ve never switched a repo from https to git, but I guess it something like git remote set-url origin git@gitlab.com/larrys/<project_name> (but I have no idea if you can even operate on origin like that).

If you really want to use that ssh config snippet, you should probably use larrys.gitlab.com in the url, instead of just gitlab.com, but there’s very little point, and I have no idea if it will work.