git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

ssh controlmaster / keep connection alive

Open axkibe opened this issue 2 years ago • 0 comments

I've been looking through the docs, I don't see an obvious way to keep a ssh connection open to specific host, in ssh world also known as "ControlMaster".

For canonical git if one puts into ~/.ssh/config

Host *
  ControlMaster auto
  ControlPath ~/.ssh/-%r@%h:%p
  ControlPersist 600

ssh will keep connections alive for all hosts and canonical git respects that (running several git fetch's will authenticate only once with the host and keep the connection alive for 10 mins)

I made some rust application using git2-rs and while I'm aware it isn't influenced by default .ssh config options by design I guess, I really wonder how I can achieve something in that effect.

I would like to keep one ssh connection alive with one particular host I'm fetching a lot of repositories updates from while the rust application keeps running. Any ideas how this is done here?

axkibe avatar Jan 11 '22 19:01 axkibe