-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyinuotu.Rmd
64 lines (57 loc) · 2.26 KB
/
yinuotu.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: "yinuotu"
output: html_document
date: "2024-09-02"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
usethis::use_git() ## Choose the option to make the commit, then to restart RStudio
## If you don't have git installed, you will likely benefit from reading
## "Happy Git and GitHub for the useR" at https://happygitwithr.com/.
```
```{r}
## After the restart, we next need to change the default Git branch to "gh-pages".
## This will make our lives a bit easier later on, as this specific name is used by
## GitHub pages https://pages.github.com/ for websites.
usethis::git_default_branch_rename(to = "gh-pages")
```
```{r}
## We will next link R to GitHub so R can act on your behalf. We will create a
## GitHub Personal Access Token (PAT) so R can say that it's acting on your behalf.
## This function guides us through the full process:
usethis::gh_token_help()
## The above command will suggest that you read more at
## https://usethis.r-lib.org/articles/articles/git-credentials.html
## which contains the latest recommendations by the usethis authors for
## configuring your R to GitHub connection.
usethis::create_github_token()
gitcreds::gitcreds_set()
## Type your GitHub token, not your password! Otherwise you might run into this
## problem: https://github.com/r-lib/usethis/issues/1347
## In some situations, gitcreds::gitcreds_set() might not work. For example,
## gitcreds::gitcreds_set() is not supported on Linux as discussed at
## https://github.com/r-lib/gitcreds/issues/29. In these situations,
## you have to rely on the old workflow of editing your
## .Renviron file with contents like (note the empty line at the end!):
# GITHUB_PAT=YOUR_40_CHARACTERS_TOKEN
#
usethis::edit_r_environ()
## Then re-start your R session.
rstudioapi::restartSession()
## Editing the .Renviron is strongly discouraged now since it stores as
## simple text your GitHub personal access token (PAT) instead of the
## more secure approach provided by gitcreds.
```
```{r}
## Next we continue by connecting your local git repository to
## GitHub. For other scenarios, you might want to use the `organisation`
## and `private` arguments
args(usethis::use_github)
## Now run use_github()
usethis::use_github()
```
```{r}
postcards::create_postcard(template = "trestles")
```