Skip to content

glab mr checkout ignores git protocol configuration and always uses SSH URLs

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: glab 1.62.0
  • Operating system and version: macOS Sequoia (Version 15.5)
  • Gitlab.com or self-managed instance? gitlab.com
  • GitLab version (if self-managed) GitLab version here (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output image

Summary

The glab mr checkout command hardcodes SSH URL usage (mrProject.SSHURLToRepo) and completely ignores the user's git protocol preferences and existing remote configurations. This causes failures for users who have configured HTTPS as their preferred protocol or work in environments where SSH access is restricted

Environment

  • OS: macOS Sequoia (Version 15.5)
  • SHELL: zsh
  • TERM: iterm2
  • GLAB: glab 1.62.0

Other:

Steps to reproduce

Set git protocol preference: glab config set git_protocol https Clone a repository using HTTPS: git clone https://gitlab.com/user/repo.git Attempt to checkout a merge request: glab mr checkout 123 Result: Command fails or uses SSH despite HTTPS preference

What is the current bug behavior?

Hardcoded SSH usage: Always uses mrProject.SSHURLToRepo regardless of user settings Ignores git_protocol config: The command doesn't check the user's git_protocol preference (which can be "https" or "ssh") Bypasses existing remotes: Creates new git configs with SSH URLs even when HTTPS remotes already exist Inconsistent with other commands: Unlike mr create and other commands that respect protocol preferences

What is the expected correct behavior?

The command should:

Respect the user's git_protocol configuration setting Use the appropriate URL protocol (HTTPS/SSH) based on user preference Follow the same pattern as other glab commands for protocol selection

Relevant logs and/or screenshots

image

Affects users who:

  • Work behind corporate firewalls that block SSH (port 22)
  • Have configured HTTPS as their preferred git protocol
  • Use CI/CD environments that require HTTPS authentication
  • Have existing HTTPS remotes that should be respected
  • Additional Context
  • This issue creates inconsistency within the glab CLI where some commands respect user protocol preferences while mr checkout does not.

Possible fixes

I want to contribute to this issue — I've already identified the problem areas and understand the solution pattern used in similar commands.

Does it fit or was it deliberately not implemented?

Edited by Munish
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information