Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Data Visualization
  • Statistics in R
  • Machine Learning in R
  • Data Science in R
  • Packages in R
  • Data Types
  • String
  • Array
  • Vector
  • Lists
  • Matrices
  • Oops in R
Open In App
Next Article:
Link your GitHub Account with R Studio
Next article icon

Link your GitHub Account with R Studio

Last Updated : 29 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

R Studio is an integrated development environment(IDE) for R Language. IDE is a GUI, where you can write your quotes, see the results and also see the variables that are generated during the course of programming. R Studio is available as both Open source and Commercial software. It is also available as both Desktop and Server versions and also available for various platforms such as Windows, Linux, and macOS.

Git is an open-source version control system. It means that whenever a developer develops some project (like an app) or something, he/she constantly update it catering to the demands of users, technology, and whatsoever it maybe. Version control systems keep these revisions straight, storing the modifications in a central repository. It allows developers to easily collaborate, as they can download a new version of the software, make changes, and upload the newest revision. Every developer can see these new changes, download them, and contribute. Git is used to storing the source code for a project and track the complete history of all changes to that code, while GitHub is a cloud-based platform built around the Git tool. So it’s necessary to upload your project on GitHub. 

Prerequisite: Before going through this article consider that one must already have a GitHub account along with R studio installed on their computer. 

Now we have both RStudio and a GitHub account, it’s time to link them together so that you can maximize the benefits of using RStudio in your version control pipelines. Here is the step by step process to link GitHub and RStudio. 

Step 1: In RStudio, Go to Tools > Global Options > Git/SVN
Tools-Global-Options-Git-SVN Then click on Create RSA Key and when this completes, click Close. Following this, in that same window again, click View public key and copy the string of numbers and letters. Close this window.
Generate-an-RSA-key
Now you have created a key that is specific to you which we will provide to GitHub, so that it knows who you are when you commit a change from within RStudio.   

Step 2: Now Go to github.com, log-in if you are not already, and Go to your account settings. There, Go to SSH and GPG keys.
SSH-and-GPG keys
Now click New SSH key. Paste in the public key you have copied from RStudio into the Key box and give it a Title related to RStudio. Confirm the addition of the key with your GitHub password.
GitHub-the-public-SSH-key
GitHub and RStudio are now linked. From here, we can create a repository on GitHub and link to RStudio.   

Step 3: Now let's create a new repository and edit it in RStudio. On GitHub, create a new repository(github.com > Your Profile > Repositories > New). Name your new test repository and give it a short description. Click Create Repository. Copy the URL for your new repository.
create-repository
  Step 4: In RStudio, Go to File > New Project. Select Version Control.
Creating-a-version-controlled-project-on-RStudio
Then Select Git as your version control software. Paste in the repository URL from before, select the location where you would like the project stored. When done, click on Create Project. Doing so will initialize a new project, linked to the GitHub repository, and open a new session of RStudio.
Cloning your-Git-repository-to-RStudio   Step 5: Create a new R script(File > New File > R Script) and copy and paste the following code and save the file. 

R
print("This file was created within RStudio")  print("And now it lives on GitHub") 


create-R-file
Once that is done, looking back at RStudio, in the Git tab of the environment quadrant, you should see your file you just created. Click the checkbox under Staged to stage your file.
stage-and-commit
Then click Commit. A new window should open, that lists all of the changed files from earlier, and below that shows the differences in the staged files from previous versions. In the upper quadrant, in the Commit message box, write yourself a commit message. Click Commit. Close the window.
Commiting-your-R-Script
So far, you have created a file, saved it, staged it, and committed it the next step is to push your changes to your online repository. Push your changes to the GitHub repository and you are done.
 push-your-commit-to-the-GitHub
 


Next Article
Link your GitHub Account with R Studio

A

AmiyaRanjanRout
Improve
Article Tags :
  • TechTips
  • Git
  • R Language
  • How To

Similar Reads

    How to Add SSH Key to Your GitHub Account?
    An SSH (Secure Shell) key is a pair of cryptographic keys used for authenticating and securing network communications over the SSH protocol. SSH keys are commonly used to securely access remote systems, transfer files, and execute commands on remote machines without passwords. Components of an SSH K
    3 min read
    How to Link GitHub with Visual Studio?
    Linking GitHub with Visual Studio allows you to manage your code repositories, collaborate with others, and streamline your development workflow directly from your IDE. Visual Studio provides integrated tools for cloning, creating, and managing GitHub repositories. Prerequisite:Visual Studio install
    1 min read
    How to Setup Git on Anypoint Studio?
    Git is essential software for developing purposes. Every developer uses Git as a backup of their work. Git is a type of Version Control System. It falls under the Distributed type of the Version Control System. There is also much another software present that serves the same as Git. But Git is famou
    5 min read
    How to Add Github to Linkedin?
    Adding a GitHub profile to LinkedIn is a great way to showcase our coding projects, contributions, and technical skills. This can enhance our LinkedIn profile by providing potential employers and professional connections with direct access to our work. There are multiple ways to add your GitHub to L
    2 min read
    How to Install R and R Studio?
    Navigating the R language installation process and setting up R Studio is crucial for anyone looking to delve into data analysis, statistical computing, and graphical representation with R. In this article, we provide a step-by-step guide on how to install R and configure R Studio on your system. Wh
    6 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences