git_ssh | R Documentation |
A use-case for this is some environments that by default initialize projects as ssl/https (e.g. RStudio Cloud) but some users may prefer ssh authentication. This easily converts between the two settings without having to remember the whole git command. Will silently return errors from shell but will not throw an error.
git_ssh(
tossh = TRUE,
sshstr = "git@github.com:",
sslstr = "https://github.com/"
)
tossh |
If 'TRUE', will attempt to convert the remote.origin.url from https to ssh. Default: 'TRUE' |
sshstr |
A string to use as the prefix for ssh connection. Optional, defaults to the values used by github.com |
sslstr |
A string to use as the prefix for the ssl connection. Optional, defaults to the values used by github.com. |
Invisibly returns '0' or an error code.
## Not run:
# Convert from https://github.com/... to git@github.com:...
git_ssh()
# Convert from git@github.com:... to https://github.com/...
git_ssh(FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.