Skip to main content

https_to_ssh

Function https_to_ssh 

Source
pub fn https_to_ssh(url: &str) -> Option<String>
Expand description

Rewrite an https://host/owner/repo(.git) (or http://) URL to its scp-like SSH form git@host:owner/repo.git. Returns None when url isn’t a plain http(s) URL with both a host and a path we can rewrite. Used to prefer SSH (deploy-key, no credential prompt) over https for private remotes.