

This also supports a transition to more expert use, because the “Git Bash” shell will be useful as you venture outside of R/RStudio. We like this because Git for Windows leaves the Git executable in a conventional location, which will help you and other programs, e.g. RStudio, find it and use it.

Yes, all those names are totally confusing, but you might encounter them elsewhere and I want you to be well-informed.

Thanks to Ewen Harrison for the "RStudio and GitHub" blog post on R-bloggers: for providing a good summary of how to use RStudio with GitHub.Option 1 ( highly recommended): Install Git for Windows, also known as msysgit or “Git Bash”, to get Git in addition to some other useful tools, such as the Bash shell. Once you have created a new branch, you can switch branches using the RStudio Git window. You may need to revert to the command line (shell) for more than the basics.įor example, to create a new branch, you will need to use the shell: git checkout -n myNewBranch The RStudio Git integration only provides a few features.

In setting up the Git project, use the SSH URL from the repository for the "Repository URL" Creating new Branches and Other Operations If you want to work on an existing project that is already in Git, create a new Project in RStudio and select the "Version Control" option Cloning an Existing RStudio Project using Git Once you have completed this step from the command line, you can push and pull from the Git RStudio window (you may need to click on the refresh button to enable the push and pull buttons). Git remote add origin SSH_URL _TO _GITHUB _REPO In RStudio, go to Tools → Shell and type: You should set up your name and email so that your commits are properly attributed to you. "RStudio") and paste the public key into the Key section, then save.
