Skip to main content

get_remote_callbacks

Function get_remote_callbacks 

Source
pub fn get_remote_callbacks<'a>(
    url: Option<&str>,
) -> Result<RemoteCallbacks<'a>>
Expand description

Build git2::RemoteCallbacks that handle credential prompts via the system credential store (SSH keys, keychain, etc.).

Uses git2_credentials::CredentialHandler which respects ~/.gitconfig credential settings and SSH agent.

If url is provided, ~/.ssh/config is consulted for an IdentityAgent directive matching the URL’s host. When found, SSH_AUTH_SOCK is updated so that libgit2 connects to the configured agent (e.g. 1Password SSH agent).