Skip to content
R for the Rest of Us Logo

Keep RStudio and GitHub in Sync

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window


Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Your Turn

  1. Create a in the github-first project and add some text

  2. Stage this file (and any other modified files) and add a commit message

  3. Hit commit

  4. After you commit, push your changes to GitHub

  5. Go to your GitHub repository and make sure you see your changes

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Juan Clavijo

Juan Clavijo

October 21, 2021

I get this error message after running use_github(): Error in curl::curl_fetch_memory(url, handle = handle) :

I just got the following error while trying to push an updated for my course project:

>>> C:/Program Files/Git/bin/git.exe push origin HEAD:refs/heads/master To ! [rejected] HEAD -> master (non-fast-forward) error: failed to push some refs to '' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Daniel Dunleavy

Daniel Dunleavy

April 13, 2022

Two questions:

  1. In a project with a lot of commits, is there a way to easily spot which changes were made locally and which were made in GitHub?

  2. Any thoughts/preferences on the GitHub desktop app vs. online interface? Pros and cons?

Jessica Brewer

Jessica Brewer

October 7, 2022

When I created the file in my github-first project, I also had a .gitignore file and a .Rproject file show up in the Git window, so I committed all three and pushed to GitHub. Is this ok?

I work with extremely sensitive data that cannot be stored in Github for privacy reasons. What would be the best ways to ensure the data is never pushed to Github, only the scripts? Would I just never select the "Staged" checkbox for the dataset(s), or are there other settings or best practices to avoid pushing the data itself?