I've been happily using SourceTree on my Mac for years and rarely had problems. A couple of weeks ago after updating macOS it suddenly stopped working altogether. Whenever I try to clone/fetch/push/pull/whatever to any of my Git repositories, SourceTree either
It's not an issue with the repositories. It's happening for Github too, with the exact same repos and settings that worked before. The key has chmod 400, same as before, and it's the default key ~/.ssh/id_rsa. Tried using the embedded Git in SourceTree and System Git, to no avail. Another app that I switched to in the meantime works normally.
I can't remember exactly which macOS update caused the issues, but I'm now using the latest macOS Catalina 10.15.4 and SourceTree 4.0.1. I wiped the disk completely clean and re-installed everything from scratch due to another problem, but it still doesn't work. I couldn't find anything about new access restrictions that prevent SourceTree from accessing the key itself, or how I could allow access if that's the case. This is driving me nuts, I've switched to another app in the meantime, but I'd really like to continue using SourceTree if it lets me.
EDIT: All my repos are affected by this problem when I'm using SourceTree on macOS. All repos are used by other people as well, it also works for me on my Mac when I use another app. Even SourceTree for Windows on my other laptop, all of those work with the same key.
In Mac, it can be changed by clicking on Gear icon > Accounts. Alternatively, you can go to the "Keychain Access" utility on the Mac, search for the remote password and delete the stored key. Then the next time you start SourceTree, it will ask you for your new credentials. Let us know if this worked for you!
From Sourcetree, open the PuTTY Key Generator dialog by going to Tools > Create or Import SSH Keys. Click Load, navigate to your SSH folder, and click the private key. Make sure you're looking at All files if you don't see your private key. Enter your passphrase for the SSH key and click OK.
1 answer. The credentials are stored in the Windows' Credential Manager, under the Windows Credentials section, stored with a 'git:' prefix.
In the Edit Hosting Account window, select the drop-down for Authentication and select Basic. Ensure your username is correct. Ensure you are using an app password and that it is also correct (ensure there is no copy and paste error when copying the app password over to Sourcetree for Windows).
Thanks for the helpful reply and comments. Turns out SourceTree doesn't add the servers' fingerprints to the ~/.ssh/known_hosts file, and fails silently.
Easy fix - navigate to your repo folder on the command line and run a simple git command, for example:
git fetch origin --dry-run
Nothing will happen since it's a dry run, but the git executable will ask if connecting to the server is ok, and add it to the known_hosts file.
Nothing worked for me until I added this to my .ssh/config
:
UseKeychain yes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With