Git clone private repo SSH

Public Git repo clone via HTTPS and push via SSH is fast and generally effective for security. For private Git repos do Git clone over SSH. Optionally, SSH Agent avoids the need to constantly type the SSH password.

Git clone with Git over SSH by simply replacing “https://” in the Git repo URL with “ssh://”. Be sure to remove the trailing “.git” from the URL if present. For example:

git clone ssh://github.invalid/username/private-repo-name

Related: GitHub Oauth access private repo