rluks
rluks

Reputation: 2862

SourceTree terminal automatically load ssh key

There are some tasks that are only possible/easier to do in git bash (or Terminal) than in SourceTree. I have most of my repositories on bitbucket and use ssh key.

enter image description here

The problem I have is that even though I load my key with SourceTree (Pageant putty client) the terminal requires me to load it again. It can be a pain with longer keyphrase as well as once the terminal is closed and opened again it is required to enter password again.

enter image description here As you can see agent is running, key is loaded, but I am still asked to enter my passphrase in git terminal/git bash.

Is there a way to load the key only once?

Thank you

Upvotes: 10

Views: 8993

Answers (2)

Fabian
Fabian

Reputation: 4211

I have the same issue that the SSH agent forgets the SSH key on every restart of my computer. The solution in my case as follows:

  1. Open Sourcetree.
  2. In the menu, go to "Tools", then "Options".
  3. Under "General" and then "SSH Client Configuration", enter the path to the SSH key.
  4. Enable the checkbox "Automatically start SSH agent when SourceTree opens"

If I leave the SSH Key field empty and instead add the key directly to the SSH agent, this is not permanent. It seems as if Sourcetree forwards the path to the SSH key to the SSH agent when it starts it.

Upvotes: 2

FullStack
FullStack

Reputation: 457

In sourcetree settings, do you have the

Automatically start SSH agent when SourceTree opens checkbox selected?

Upvotes: 2

Related Questions