pub fn connect(
    host: &str,
    path: BString,
    desired_version: Protocol,
    user: Option<&str>,
    port: Option<u16>
) -> Result<SpawnProcessOnDemand, Error>
Expand description

Connect to host using the ssh program to obtain data from the repository at path on the remote.

The optional user identifies the user’s account to which to connect, while port allows to specify non-standard ssh ports.

The desired_version is the preferred protocol version when establishing the connection, but note that it can be downgraded by servers not supporting it.

Environment Variables

Use GIT_SSH_COMMAND to override the ssh program to execute. This can be a script dealing with using the correct ssh key, for example.