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
Install Git
This lesson is locked
This lesson is called Install Git, part of the Using Git and GitHub with R course. This lesson is called Install Git, 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
Confirm that you installed Git correctly by going to your terminal in RStudio and typing
git --version
(you should have version 2.3 or later)
You need to be signed-in to comment on this post. Login.
Juan Clavijo
October 18, 2021
Had to restart R studio for git version to come up in the terminal
Sarah Tyne
October 20, 2021
Yes, me too.
Hannah Koenker
October 20, 2021
I was stuck. I installed Git but got 'object not found' when I restart RStudio and checked it. Turns out I was typing in the Console but needed to be in the Terminal. Just in case others make this mistake :)
Eric Foerster
October 20, 2021
No problems with downloading Git. Using a Mac. Updated R and RStudio with no issues. However, the git --version I'm getting is 2.24.3 (Apple Git-128). Have tried downloading it again several times and cannot get version 2.33. Any ideas???
David Keyes
October 21, 2021
That version is new enough that it should be fine.
Mychal Davis
April 14, 2022
Hello, I have Git Bash installed on my machine, do I need to install GIT too?
Charlie Hadley
April 15, 2022
Hi Mychal,
Git bash installs both git and tools that allow you to make use of git in the Command Prompt. In principle, you'll never use the command prompt and will instead use the Git tab in RStudio.
Cheers,
Charlie
Norm Anderson
April 15, 2022
I don't think the installation went well. I do not see the version. I have restarted RStudio.
Microsoft Windows [Version 10.0.19043.1645] (c) Microsoft Corporation. All rights reserved.
C:\Users\norma\OneDrive\Desktop\Week 3 - R in 3 Months>git -- version unknown option: -- usage: git [--version] [--help] [-C ] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [--super-prefix=] [--config-env==] []
Microsoft Windows [Version 10.0.19043.1645] (c) Microsoft Corporation. All rights reserved.
C:\Users\norma\OneDrive\Desktop\Week 3 - R in 3 Months>git--version 'git--version' is not recognized as an internal or external command, operable program or batch file.
Shira Solomon
April 17, 2022
I installed Git and get this error message when looking for it in the R Studio terminal: " 'git' is not recognized as an internal or external command, operable program, or batch file. " Git GUI, Bash, and CMD all appear in my file tree. Can you help? Thanks!
Shira Solomon
April 17, 2022
Problem solved (mine at least)! Turns out R Studio didn't like my character spacing. It responded just fine when I followed David's example: [no space] git [space] --[no space]version
Norm Anderson
April 18, 2022
Shira, that was my problem also . . . spacing.
Niger Sultana
April 22, 2022
bash: git version: command not found is shown after installing git. is it okay? I did not found any instruction to restart R studio. Am I following right way to install Git?
Charlie Hadley
April 22, 2022
Hello Niger,
Could you try writing this
git --version
To explain, git is a command and version is a flag. Bash is telling you it can't find a command called version which is true because version isn't a command.
Thanks,
Charlie
Niger Sultana
April 22, 2022
Thanks Charlie, it worked. Message came up git version 2.35.3.windows.1. Is anything can be copied from terminal pane?
Charlie Hadley
April 22, 2022
Hi Niger. Once you've confirmed that git is installed you shouldn't need to use the terminal for any git operations. Instead you can use the functions use_git() and use_github() from the {usethis} package. Thanks, Charlie
Julieth Silao
October 6, 2022
i follw all the steps but i get
object git not found
David Keyes
October 6, 2022
Are you sure you're working in the terminal, not the console?
Matt Kropp
October 25, 2022
Followed the steps and it is showing an older version 2.15.0. On a M1 Mac.
David Keyes
October 25, 2022
Did you download git from here? https://git-scm.com/downloads
Matt Kropp
October 26, 2022
Third time installing worked. Weird.
David Keyes
October 26, 2022
I'm often confused by things like this, but glad when they finally work!
Elsa Bailey
October 29, 2022
It appears that for Mac we must not click on "installer" but on the 2.33 link. Had to do that to get the updated version. (Clicking on installer gave me a 2.15.0 version)
David Keyes
October 31, 2022
Good to know!
Kiana Robinson
April 20, 2023
Kianas-MacBook-Pro:Week 3 kianaramisi$ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Kianas-MacBook-Pro:Week 3 kianaramisi$ git--version bash: git--version: command not found Kianas-MacBook-Pro:Week 3 kianaramisi$ git --version xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun Kianas-MacBook-Pro:Week 3 kianaramisi$
Why this? Why me?
David Keyes
April 20, 2023
Can you please try install the Xcode command line tools using instructions here? Let me know if that fixes the problem!
Kholida Karimova Hashkes
April 22, 2023
Do I need to install Git if I'm planning to use GitHub only?
David Keyes
April 23, 2023
Yes, Git is what you use locally on your system. GitHub is what you use to share code with others.