Why do you recommend using Putty over OpenSSH to connect to a git server from windows?

msysgit includes all ssh tools and you can share the private key between the command-line and server. You can do that with putty tools, but there are many more steps involved.

2 answers

1 accepted

1 vote
Accepted answer

FWIW you can use PuTTY for the command line too (Git offers the option at setup, it just defaults the other way around).

We recommend PuTTY because it's Windows-native. If you use passphrases with your keys (and really, you should - if you don't your keys are very insecure) then you need to run an agent to avoid typing those passphrases more than once per login. OpenSSH's agent is a command-line affair and can only easily be used from inside the same command line prompt, so it doesn't play very nicely with using a mixture of command line and a GUI tool like SourceTree. In contrast, PuTTY uses a Windows system tray tool called Pageant which can serve any number of apps and sits in your tray for your Windows session. Many people also prefer the GUI tools for generating keys since they're a bit more user-friendly.

SourceTree jumps through the hoops required to make OpenSSH work with passphrases outside a terminal so it's fine if you want to use it, but OpenSSH was designed for Unix/Linux terminals and has to be somewhat shoehorned into working nicely in a Windows GUI setup, hence why we suggest the native tool as a preference. Many people will have already set up their systems for OpenSSH which is fine, but PuTTY can do everything OpenSSH does while being a bit more of a natural fit, so we tend to recommend it to brand new users since they'll probably have an easier ride.

When you say "Git offers the option...", do you mean GitHub for Windows? I just re-installed msysgit, and I didn't see that option.

He means Git for Windows. And, you will only see that installer wizard page if you have already created a PuTTY SSH session (and to be honest, I don't think it necessarily has to be a SSH session–I think any type of session will do). Otherwise, the installer won't give you the option and will default to using OpenSSH. I only know this because I'm currently working on an MSI installer for Git for Windows. You wouldn't know this about the current Git for Windows installer unless you scrutinize the installer source code.

Yes, this is not what one would expect–so I'm hoping to change that with the MSI installer I'm working on. It's my hope that if I detect PuTTY installed on the user's machine, they will be given the choice to use PuTTY over OpenSSH. If there are no PuTTY sessions, you will be warned, but you can still choose to make PuTTY the default SSH client for Git for Windows.

But, the new MSI installer for Git for Windows is currently under active development and is still a bit far off. So keep an eye out for it. In the meantime, I'm sure there are resources online that can tell you how to switch from OpenSSH to PuTTY for Git for Windows "after the fact".

0 votes
Timothy Chin Community Champion Jun 17, 2013

I guess it all boils down to personal preference and maybe even policies.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,123 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you