Git operations that address a remote use a so-called "transport protocol". usethis supports HTTPS and SSH. The protocol dictates the Git URL format used when usethis needs to configure the first GitHub remote for a repo:
protocol = "https"
implieshttps://github.com/<OWNER>/<REPO>.git
protocol = "ssh"
impliesgit@github.com:<OWNER>/<REPO>.git
Two helper functions are available:
git_protocol()
reveals the protocol "in force". As of usethis v2.0.0, this defaults to "https". You can change this for the duration of the R session withuse_git_protocol()
. Change the default for all R sessions with code like this in your.Rprofile
(easily editable viaedit_r_profile()
):use_git_protocol()
sets the Git protocol for the current R session
This protocol only affects the Git URL for newly configured remotes. All existing Git remote URLs are always respected, whether HTTPS or SSH.