Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-19534

"Check out in Sourcetree" button forces SSH URLs if user has an SSH key set up

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Based on a question I posted at https://community.atlassian.com/t5/Bitbucket-questions/FORCE-Bitbucket-Sourcetree-to-use-HTTPS-instead-of-SSH/qaq-p/1200432?utm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_reply&utm_content=topic, I was encouraged to create an issue in the public tracker.

      Steps to reproduce

      1. In Sourcetree, add an existing Bitbucket repo using the HTTPS clone URL
      2. In Bitbucket Cloud, attach an SSH key to your user account
      3. Create a new branch in a repository
      4. Click on the "Check out in Sourcetree" button on the branch post-creation page

      Actual behavior

      Sourcetree opens and attempts to check out your branch using an SSH URL for that repo. Older versions (3.1.x on Windows) will simply throw a "This is not a valid source path / URL" error in Sourcetree. The current version of Sourcetree for Windows will first ask you to add an SSH key to Pageant to connect to the repo via SSH. If you reject this dialog, another will appear saying no SSH keys were configured, and then you get the "This is not a valid source path / URL" error as before.

      Requested behavior

      Allow the user to choose on the branch post-creation page whether to use an SSH URL or an HTTPS URL for Sourcetree, similar to the selector on the Clone Repository dialog. Alternatively, maybe convert the SSH URL into an HTTPS URL on the fly if Sourcetree detects a URL that uses a different protocol from the one used to set up the repo in Sourcetree.

      Background

      I needed to add an SSH key to my Bitbucket account to allow passwordless logins in one of my build pipelines. However, elsewhere I am quite happy with my current account login-based setup, and don't really want to set up SSH keys on all the machines I access Bitbucket from.

      However, as soon as you set up an SSH key in Bitbucket Cloud, it automatically assumes you want to use SSH URLs for everything. This means any Sourcetree installs I have that still use account logins to access private repos will no longer work when I click the "Check out in Sourcetree" button.

      The current workarounds appear to be either

      • set up every machine that needs access via my account with its own SSH key;
      • copy the SSH key to all machines that need it;
      • stop using the "Check out in Sourcetree" button and resort to standard git commands

      Attachments

        Activity

          People

            Unassigned Unassigned
            df8c2baf58da Wesley Fok
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: