- Status:Gathering Interest(View Workflow)
- Component/s:Integration - Sourcetree
- Feedback Policy:
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.
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.
When you set up SSH key, you create a key pair that contains a private key (saved to your local computer) and a public key (uploaded to Bitbucket). Bitbucket uses the key pair to authenticate anything the associated account can access. This two-way mechanism prevents man-in-the-middle attacks. This first key pair is your default SSH identity. I successfully added the ssh public key to Bitbucket and it is correctly installed on my system (ie visible from ssh-add). When I use the git command line everything works fine: for every remote git command to Bitbucket (even from a terminal launched from Sourcetree), macOS asks me the pin to properly unlock my Yubikey (where the private key is. SSH keys are used to authenticate secure connections. Following this guide, you will be able to create and start using an SSH key. Git is capable of using SSH keys instead of traditional password authentication when pushing or pulling to remote repositories. Modern hosted git solutions like Bitbucket support SSH key authentication. If I try to connect to bitbucket.org:443 (in a Git bash terminal window) by using: ssh -v [email protected] -p 443 The program establishes a connection, but now my problem is to configure that port in the Git client (I don't see any port configuration setting in the Options dialog inside SourceTree). Thanks in advance for any help.
Steps to reproduce
- In Sourcetree, add an existing Bitbucket repo using the HTTPS clone URL
- In Bitbucket Cloud, attach an SSH key to your user account
- Create a new branch in a repository
- Click on the 'Check out in Sourcetree' button on the branch post-creation page
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.
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.
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
Sourcetree Ssh Bitbucket Server
- 2Vote for this issue
- 1Start watching this issue