Confirmed on main and on v0.0.42. Add Project → Clone → GitLab looks the repository up, then clones sshUrl. There is no protocol picker, so a host that signed in to glab over HTTPS and has no GitLab SSH key fails exactly as described.
getDefaultCloneUrl returns repository.url only for GitHub and Forgejo. GitLab falls through to repository.sshUrl:
| 1 | /** GitHub and Forgejo default to HTTPS; other providers retain their existing SSH default. */ |
| 2 | export function getDefaultCloneUrl(repository) { |
| 3 | return repository.provider === "github" || repository.provider === "forgejo" |
| 4 | ? repository.url |
| 5 | : repository.sshUrl; |
| 6 | } |
packages/client-runtime/src/operations/projects.ts. The test next to it locks GitLab to git@gitlab.com:group/project.git. Last change is 6fd68f5c3 (#11436), which added Forgejo to the HTTPS branch and left GitLab on SSH. v0.0.42 has that same function. Nightlies through v0.0.43-nightly.20260923.2173 are not past it.
Web (CommandPalette) and mobile (AddProjectScreen) both pass that string as remoteUrl and do not send provider, repository, or protocol. prepareClone only replaces the URL when both provider and repository are set, so the server clones the SSH URL as given. Host key verification failed is what git prints for git@gitlab.com:… when gitlab.com is not in known_hosts.
On web, the confirm header shows repository.url (the HTTPS web URL) while the clone uses sshUrl, so the palette displays a URL it does not clone. Mobile shows the SSH URL on the destination screen. Neither surface can switch protocol. Pasted Git URLs are unaffected. normalizePastedCloneUrl leaves https://gitlab.com/… alone.
This is the GitLab case of #4203, which #7760 fixed for GitHub only. #13246 (self-hosted SSH identity on a custom port) and #9422 (looking up a pasted GitLab URL) are different.
#13351 already applies the same HTTPS default to GitLab and leaves Bitbucket and Azure DevOps on SSH. That matches #7760: it does not read git_protocol. Worth knowing before merging:
- GitLab's
urlfield isweb_url(https://gitlab.com/group/project), nothttp_url_to_repo(….git).http_url_to_repois parsed inGitLabCli.normalizeRepositoryCloneUrlsand dropped. Git accepts the web URL, andcredential.https://gitlab.com.helperis host-scoped, so theglabhelper still applies. The PR test fixture puts a.gitURL inurl, which is not what lookup returns. - Interactive
glab auth loginpre-selects HTTPS and, for a non-SSH choice, offers the credential helper. The config default whengit_protocolis unset is still SSH. An unconditional HTTPS default fixes this report and will send SSH-onlyglabusers down HTTPS, with no in-app way back. That is the same tradeoff #7760 already made for GitHub. Readingglab config get git_protocolwould avoid it, and it is a larger change than this bug needs.
Workaround in the report is the same rewrite that unblocked #4203, and it is the right one until #13351 lands. No newer release contains a fix.