Get access to all lessons in this course.
-
Introduction to Git and GitHub
- What is Git? What is GitHub?
- Why Should You Learn to Use Git and GitHub?
- Update Everything
-
Git
- Install Git
- Configure Git
- Create a Local Git Repository
- Commits
- Commit History
-
GitHub
- GitHub Repositories
- Connect RStudio and GitHub
- Push an RStudio Project to a GitHub Repository
- Pull a GitHub Repository to an RStudio Project
- Keep RStudio and GitHub in Sync
-
Collaborating with Git and GitHub
- Why Use GitHub vs Dropbox, Google Drive, Box, etc?
- Dealing with Common Problems: Can't Pull Code from GitHub
- Dealing with Common Problems: Merge Conflicts
- Dealing with Common Problems: Can't Push Code to GitHub
- Let's Keep Bad Things from Happening in the First Place
-
Branches
- What are Branches and Why Should We Use Them?
- Branch Names
- How to Create Branches
- Using Pull Requests to Merge a Branch Into Main
-
Project Management with GitHub
- GitHub Issues
- How to Organize Issues
-
Wrapping Up
- Other Cool Stuff You Can Do with GitHub
Using Git and GitHub with R
Create a Local Git Repository
This lesson is locked
This lesson is called Create a Local Git Repository, part of the Using Git and GitHub with R course. This lesson is called Create a Local Git Repository, part of the Using Git and GitHub with R course.
Transcript
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
Create a new RStudio project called
local-first
Add a new Git repository to your project using the
use_git()
functionMake sure the Git tab shows up in the top right panel

You need to be signed-in to comment on this post. Login.
Kevin Kairouz
October 20, 2021
I get this error when using use_git() : Function executeCommand not found in RStudio
anyone has a work around?
David Keyes
October 20, 2021
What version of RStudio do you have? You can check by going to RStudio > About RStudio.
Julieth Silao
October 6, 2022
hello David. I connect with my username and email, but the email doesn’t pick up while its the same email i used in github account. can you help
David Keyes
October 6, 2022
I see you have questions on the Install Git lesson. I think we need to get that sorted first before you can create a local git repository.
Ben Skutnik
October 6, 2022
Hi David,
I've got the most current versions of R (4.2.1) and RStudio (2022.07.2+576) and updated all of my packages (though gert has a zero-exit warning). But two differences have come up while following your instructions.
Any help would be appreciated.
Ben Skutnik
October 6, 2022
Nevermind, I was able to solve it. RStudio's default git path wasn't the same as a $which git
Elsa Bailey
October 30, 2022
Hi, I can't seem to get the Git tab to show. I've created a "local-first" project, and within that ran the following: library(usethis) > use_git_config(user.name = "Elsa Bailey", user.email = "ebbailey@earthlink.net") > library(usethis) > use_git() ✔ Setting active project to '/Users/elsabailey/Desktop/local-first' > I never see the "create a git repository" check box when creating a new project, and I never see a message about "initialising Git Repo". I've tried following the steps in all the lessons several times, have confirmed that I have installed git 2.33.0, but can't seem to get to a screen in RStudio that shows the Git tab. I also never get a message asking to restart RStudio to activate the Git pane. I've tried quitting and restarting it myself, but that doesn't reconfigure the tabs either. I am stuck, and can't proceed with the subsequent lessons as a result. Any advice will be appreciated. Thanks!
Charlie Hadley
October 31, 2022
Hi Elsa,
This is a frustrating issue - sorry! As we have a 1:1 scheduled for Tuesday 1st November is it okay if we discuss it then? We can extend the session to ensure that git is working for you on top of the questions you bring.
Thanks,
Charlie
Nicholas Lai
April 17, 2023
Hi David, When I run all the prompts the tab doesn't show up still. Not sure how to fix this issue. Nick
David Keyes
April 17, 2023
Can you please record your screen so we can see what's going on? Please show yourself entering the code in the console and then show the Git tab not appearing. Please let us know when you've shared the video (we don't get notifications). Thanks!
Nicholas Lai
April 18, 2023
I've figure it out. Thanks!
Chelsea Ruder
May 1, 2023
Hi David - I thought we problem solved this last week but I am still getting errors when setting up a git repository.
Error in libgit2::git_signature_default : config value 'user.name' was not found
I can try to get to office hours tomorrow to troubleshoot.