Connecting Git with R-Studio

In a few simple steps.

Git is good at version control. So integrating R with git will help you manage all your codes and workspace in a proper manner.

Once you have installed R-studio, Git and SVN

Open R-studio and click on tool from taskbar and navigate to Global Options

Navigate to “Git/SVN”. If you installation was performed correctly the directory to your git and svn will be mentioned.

Click on “Create RSA Key”. On the new Pop-Up select “Create”. The RSA file will be stores in a directory (You can choose your own desired directory too).

Click on “View public key” and copy all the contents inside it. The Key Begins with ‘ssh-rsa’, ‘ssh-ed25519', ‘ecdsa-sha2-nistp256’, ‘ecdsa-sha2-nistp384’ or ‘ecdsa-sha2-nistp521’ .

Open Browser and Sign in to Github

Go to your profile drop down and select settings.

On the settings page select “SSH and GPG keys” option

Paste the Key you copied in the Key Text Box. Add a title example R Studio. Once done Click add “SSH Key” It will be visible on the SSH key list

Let’s Create Repository for our project. There are multiple ways to create a repository. Click on the “+” icon near your profile picture on the top right and select “New Repository” on the drop down list.

  • Name your Repository
  • Add Description
  • Choose if you want the mode to be private or public
  • Check out the list of optional requirements (“README file”, “.gitignore” and “Choose a License”)
  • Click on create repository

Copy the repository URL

Let’s go back on R-Studio and Create a new project

Select Version Control

Select Git

Add the repository Url you copied and paste it in Repository Url box

Also select a subdirectory of the project and click on “Create Project”

Now your R-studio will have a git tab either next to “Connections Tab” or “Terminal Tab”

Create a new R-Script . And add your contents / Codes

Save the script. The file will appear on the Git tab.

To upload Tick the staged checkbox next to the file name and then click on commit or push as required

That’s all. You did it.

Follow me on GitHub

*R-Studio requires R to be installed in order to wo

Tried Everything. Coding to Visual Arts. Still Figuring Out. More info @

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store