-
Notifications
You must be signed in to change notification settings - Fork 11
CBD GitHub and RStudio Git Instructions
Michael Samuel edited this page Mar 5, 2019
·
4 revisions
- Create a GitHub account at https://github.com/
- Get setup to use Git with RStudio (more detailed instructions at https://support.rstudio.com/hc/en-us/articles/200532077?version=1.1.453&mode=desktop):
- install Git using the appropriate method for your platform here: http://git-scm.com/downloads
- activate Git in RStudio on your system [note: if you have installed Git a long time ago, it would be good to update or install a new version]:
- Open R Studio
- Go to Global Options (from the Tools menu)
- Click Git/SVN
- Click Enable version control interface for RStudio projects
- If necessary, enter the path for your Git executable file in the box provided
- it is probably in a folder like: c:\Users\YOURUSERNAME\AppData\Local\Programs\Git\bin
- As far as I can tell, ignore the "SVN Executable" and “SSH RSA Key" boxes
- EXIT R and get back in
- RStudio's version control features are tied to the use of Projects
- Create a new project based our remote CCB GitHub repository
- Create a new project
- (one way is:) --> File --> New Project
- Create a new project
- as part of creating the new project choose "Version Control"
- Choose "Git"
- Provide the repository URL, https://github.com/mcSamuelDataSci/CACommunityBurden, (and other appropriate options)
- Choose an appropriate folder on your computer in which to store the project and give the project and appropriate name (e.g. "samuelCCB")--this project name will also be the name of a new folder Git will create
- click "Create Project"
- (not essential, but helpful) Add/edit your user name and email to RStudio-Git in a "command window". Access a command window via the "Terminal" tab next to the "Console" tab
- git config --global user.email "[email protected]"
- git config --global user.name "Mona Lisa"
- Michael needs to add you as a collaborator before you can "push" to the CCB GitHub repository
- To avoid having to enter login and password when, committing and pushing from RStudio to GitHub: Install credential manager: https://github.com/Microsoft/Git-Credential-Manager-for-Windows/releases/download/v1.16.2/GCMW-1.16.2.exe
- to "Activate" git with a new project if needed
- Open that project
- Tools --> Version Control --> Project Setup
- Select Git/SVN -> from "Version Control System" select Git -->
- Nice git cheat sheet: https://ndpsoftware.com/git-cheatsheet.html