-
-
Save juanchiem/aefec4211359ebf40b4b0624fc0dfba6 to your computer and use it in GitHub Desktop.
Configure GitHub for Rstudio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: | |
## Windows -> https://git-scm.com/download/win | |
## Mac -> https://git-scm.com/download/mac | |
## Linux -> https://git-scm.com/download/linux | |
## or: $ sudo dnf install git-all | |
# ---------------------------------------------------------------------------- | |
### 3. Configure git with Rstudio ############################################ | |
## set your user name and email: | |
usethis::use_git_config(user.name = "YourName", user.email = "[email protected]") | |
## create a personal access token for authentication: | |
usethis::create_github_token() | |
## in case usethis version < 2.0.0: usethis::browse_github_token() (or even better: update usethis!) | |
## set personal access token: | |
credentials::set_github_pat("YourPAT") | |
## or store it manually in '.Renviron': | |
usethis::edit_r_environ()` | |
## store your personal access token with: GITHUB_PAT=xxxyyyzzz | |
## and make sure '.Renviron' ends with a newline | |
# ---------------------------------------------------------------------------- | |
#### 4. Verify settings ###################################################### | |
usethis::git_sitrep() | |
## Your username and email should be stated correctly in the output. | |
## Also, the report shoud cotain something like: | |
## 'Personal access token: '<found in env var>'' | |
# ---------------------------------------------------------------------------- | |
## THAT'S IT! | |
Cambiar las URL remotas de HTTPS a SSH | |
Abre la Terminal. | |
Cambiar el directorio de trabajo actual en tu proyecto local. | |
Enumerar tus remotos existentes a fin de obtener el nombre de los remotos que deseas cambiar. | |
$ git remote -v | |
> origin https://github.com/USERNAME/REPOSITORY.git (fetch) | |
> origin https://github.com/USERNAME/REPOSITORY.git (push) | |
Cambiar tu URL remota de HTTPS a SSH con el comando git remote set-url. | |
$ git remote set-url origin [email protected]:USERNAME/REPOSITORY.git | |
Verificar que la URL remota ha cambiado. | |
$ git remote -v | |
# Verify new remote URL | |
> origin [email protected]:USERNAME/REPOSITORY.git (fetch) | |
> origin [email protected]:USERNAME/REPOSITORY.git (push) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment