This works if you authenticate using a public/private key pair:
-
Open Sourcetree and go to "Tools > Create or Import SSH Keys" (this will open a PuTTY Key Generator window),
Set the number of bits in a generated key
to 2048 and click on "Generate". -
Once generated go to git server panel and navigate to "My account > Profile > SSH Keys" and click "Add a public key".
-
Copy the generated public key from the "PuTTY Key Generator" window ("Public key for pasting into OpenSSH authorized_keys file:") to git panel and save it.
-
In the "PuTTY Key Generator" window enter a "Key passphrase" and "Confirm passphrase" and click "Save private key" and Public Key (for other uses too). Make sure to save it somewhere where you can find it again.
-
Close the "PuTTY Key Generator" window and in SourceTree go to "Tools > Launch SSH Agent (Pageant)". You should be able to select your private key file here. (the one you just saved), Enter the passphrase and you're done.
Now try pushing!
Does not work. GitHub error: Key is invalid. You must supply a key in OpenSSH public key format