Skip to content

Instantly share code, notes, and snippets.

@irazasyed
Created March 11, 2014 15:42
Show Gist options
  • Save irazasyed/9488426 to your computer and use it in GitHub Desktop.
Save irazasyed/9488426 to your computer and use it in GitHub Desktop.
Git: SourceTree - Remote Error fix for Windows Users.

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!

@don-odyssey
Copy link

Does not work. GitHub error: Key is invalid. You must supply a key in OpenSSH public key format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment