amdev
amdev

Reputation: 3249

Public key issue with command line in sourceTree (git )

I usually use git on linux and I'm not familiar with sourceTree on windows ( c# project ), the interface is usefull to follow the tree, but I would like to the use commande line .

I really don't understand, I generated my ssh key with sourceTree agent and load with "Pageant", I added the public key on my bitbucket account.

And it works. I can clone/pull/push from the sourceTree interface

fetch with sourceTree's interface

But using the sourceTree command line mode doesn't work

command line doesn't works

Upvotes: 6

Views: 3480

Answers (4)

Justo Salcedo
Justo Salcedo

Reputation: 19

"C:\Users\username\AppData\Local\SourceTree\app-3.4.8\tools\putty\plink.exe" bitbucket.org

change username and app-

Upvotes: 0

Mike Lischke
Mike Lischke

Reputation: 53337

Nothing of the above was necessary to make it work for me. The only necessary aspect to consider is that by default git (and maybe other apps) expect your ssh key in c:/users/<user>/.ssh. Mind the dot! After I renamed my ssh folder to .ssh all started working fine.

Upvotes: 1

AndreKR
AndreKR

Reputation: 33678

  1. Set SSH Key to a PuTTY private key (.ppk) and set SSH Client to PuTTY / Plink
  2. Set an environment variable GIT_SSH to the path of plink.exe, for example C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe

Of course you could have a separate, global OpenSSH key in %HOMEPATH%\.ssh\id_rsa but then you would lose the advantage of SourceTree loading the correct key automatically.

By the way, I can confirm that neither of these work:

  • Setting SSH Key to an OpenSSH private key and using OpenSSH as SSH Client
  • Setting SSH Key to a PuTTY private key and using PuTTY / Plink as SSH Client

Upvotes: 4

Zainul Abdin
Zainul Abdin

Reputation: 835

you need to generate public key from console.

like this

 ssh-keygen

it will generate public key that you can add it in Bitbucket

for more info visit this Tutorial

Upvotes: 0

Related Questions