1. Prerequisites (chapter 12)

 

2. Make a repo on GitHub

Go to https://github.com and make sure you are logged in.

On your own profile page, click on “Repositories”, then click the green “New” button.

Then to fill like this:

For everything else, just accept the default.

Click big green button “Create repository.”

Click the green “Code” button, then copy the HTTPS clone URL to your clipboard

 

3. Clone the repo to your local computer

In RStudio, start a new Project:

 

4. Push your local changes online to GitHub

Go to the shell. In RStudio, Tools > Shell

Type these command lines one by one:

Note: Every time you make a commit you must also write a short commit message. Ideally, this conveys the motivation for the change.

 

5. Confirm the local change propagated to the GitHub remote

Go back to the browser. Reload the Github webpage.You should see all your local files of this project being uploaded to the repo.

 

6. How if changes are made from Github and you want to sync in your local computer (chapter 15)

 

7. View HTML file published on Github online (chapter 33)

To preview HTML files on GitHub is to go to https://htmlpreview.github.io/ or just prepend it to the original URL, i.e.: https://htmlpreview.github.io/?https://github.com/Kaining26/practice/blob/main/2ndrmd.html

 

Reference: Happy Git and GitHub for the useR

https://happygitwithr.com/