vignettes/publish-review-on-github.Rmd
publish-review-on-github.Rmd
Currently we’ve not integrated the creation of an remote GitHub repo but we’re exploring this functionality also. In the mean time, you can create a repo to publish your review in two ways:
Head over to to your repositories tab on Github.
"{pkgname}-review"
.Click on Clone or download and copy the link displayed
Open a terminal (in Rstudio go to Tools > Terminal > New Terminal). In the terminal, ensure you are in the review project.
Add your github repo as a remote by running the following code in the terminal, substituting in the link you copied from GitHub.
git remote add origin <the-link-you-copied-from-github>
git push -u origin master
For example, in my case I add my repo to as a remote like so:
git remote add origin https://github.com/annakrystalli/rdflib-review.git
git push -u origin master
Follow any authentication steps required
usethis::use_github()
To use usethis::use_github
, you’ll need to supply a github personal access token (PAT) token. The easiest way to set it up for all your r workflows is to store you PAT in a GITHUB_PAT
system variable in your .Renviron dotfile. To do this:
Generate PAT: visit github, follow instruction to generate a PAT.
Add PAT to your .Renviron
dot file: Use usethis::edit_r_environ()
to open your user level .Renviron
, paste the copied PAT token from github and save it like so:
Create Github repo & add as remote: Now, while in your review project in Rstudio, run:
to create a github repository for your review and add it as a remote for your review project. The naming of the github repository is handled automatically.
Warning! Because of ongoing big changes in dependency git2r
, you may encounter authentication problems with usethis::use_github()
. Refer to this discussion thread for further details.
In the git
panel in Rstudio, select the files you want to share on github. You can chose to only share index.nb.html
, the rendered report or include the index.Rmd
. Also select README.md
so your repository has an appropriate README from which your review can be accessed.
Commit the files adding an appropriate commit message
Push your changes to GitHub
In your review GitHub repository click on Settings
Scroll down to the GitHub Pages section and change Source location to master branch
Github Pages is now enabled and your report review will be published at the link displayed: