-
Which one is the recommended |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The default on both github.com (the website) and in GitHub CLI is using the HTTPS protocol for git operations. This default was chosen for interoperability and ease of use:
Some users prefer SSH for git operations, arguing that SSH key authentication is more secure than sending credentials over HTTPS. I'm not a security expert so I can't comment on the tradeoffs of SSH vs. HTTPS, but my personal recommendation is that for the average user, HTTPS offers adequate security. Usability-wise, SSH key authentication can have some hurdles:
To tell GitHub CLI that you prefer the SSH protocol for git operations, you can do:
Because of the steps and knowledge involved, my personal recommendation is that SSH keys are only used by users who have a strong reason to do so. If you find yourself doing work with git repositories in an organization, ask within your organization which mode of security they prefer. |
Beta Was this translation helpful? Give feedback.
The default on both github.com (the website) and in GitHub CLI is using the HTTPS protocol for git operations. This default was chosen for interoperability and ease of use:
gh auth login
. Upon completion of the login flow, GitHub CLI will configure itself as a git credential manager and ensure that all git operations forhttps://github.com
are authenticated with gh's own token.Some users prefer SSH for git operations, arguing that SSH key authentication is more secure than s…