Search code examples
gitssh-keys

What are the differences between, credentials.helper (to avoid re-enterian account and password) and using SSH keys?


I would like to know the main differences between storing your credentials with git's credentials.helper locally (to avoiding account and password reiteration) and using SSH key?


Solution

  • git credentials.helper store my account and password in cache memory but that does not mean that it's safer than using ssh keys, right?

    It is different.

    First, you won't store your password, but a PAT (Personal Access Token), with the right scope.
    Such token would start with ghp_ (since Q1 2021).
    That way, you keep your password private, and use a token that you can revoke/replace at any time, without losing access to your GitHub account.

    The credential helper would be use only for remote URLs starting with http(s)://.

    For SSH URLs, like git@github.com:<me>/<myRepo>, the credential helper would not be used at all.

    Only SSH Keys or (since May 2021) Security Keys (like Yubikey) would be used.