@@ -8,7 +8,10 @@ But for clarity, we will review the most important parts here.
88
99You don't need to set these if you work only through the GitHub web interface.
1010If you use VS Code or other editors or integrated development environments,
11- the editor might prompt you to set these up.
11+ the editor might prompt you to set these up. If you use RStudio, you can carry
12+ out the configuration in RStudio (see the RStudio tab in the section [ Authenticating
13+ to GitHub] ( https://coderefinery.github.io/git-intro/configuration/#authenticating-to-github-ssh-or-https-or-vs-code )
14+ below).
1215
1316These configuration settings are saved in a file called ` .gitconfig ` in your
1417home directory. If this file exists, editors like VS Code will use this
@@ -81,16 +84,18 @@ to set other editors, or do a web search for "git set editor to
8184% This anchor used for linking from other lessons
8285(clone-method)=
8386
84- ## Authenticating to GitHub: SSH or HTTPS or VS Code?
87+ ## Authenticating to GitHub: SSH or HTTPS or VS Code or RStudio ?
8588
86- ** How does GitHub know who you are?** We discuss here three options:
89+ ** How does GitHub know who you are?** We discuss here four options:
8790- ** SSH** is the classic method, using [ Secure Shell
8891 Protocol] ( https://en.wikipedia.org/wiki/Secure_Shell ) remote connection
8992 keys.
9093- ** HTTPS** works with the ** Git Credential Manager** , which is an
9194 extra add-on that works easily in Windows and Mac.
9295- ** VS Code** editor can authenticate with GitHub using its own
9396 authentication method.
97+ - ** RStudio** can handle authentication via HTTPS or SSH.
98+ Here, the RStudio instructions cover using ** HTTPS** .
9499
95100Read how to install them from the [ installation
96101instructions] ( https://coderefinery.github.io/installation/ssh/ ) .
@@ -144,4 +149,25 @@ Test which one you should use:
144149 If you don't want VS Code to be connected to your GitHub account,
145150 set up and use the SSH method instead.
146151 ::::
152+
153+ ::::{group-tab} RStudio
154+ See our [ installation instructions] ( https://coderefinery.github.io/installation/ssh/ )
155+ for how to run the GitHub configuration directly in RStudio using commands
156+ in the R package ` usethis ` and how to test that everything worked. These
157+ instructions use ** HTTPS** for authentication.
158+
159+ After the configuration, you should ** select HTTPS as the clone URL from
160+ GitHub, or translate the URL to start with the right thing
161+ yourself:** ` https://github.com/ `
162+
163+ To set your default branch name in Git to ` main ` in RStudio, run
164+
165+ ```r
166+ usethis::git_default_branch_configure()
167+ ```
168+
169+ Any configuration steps above that are not covered in the RStudio instructions
170+ can be run in the Terminal tab of RStudio's console panel.
171+
172+ ::::
147173:::::
0 commit comments