Rob Causey
Rob Causey

Reputation: 363

Using RStudio to Make Pull Requests in Git

My enterprise has a Git repository. To make changes, I have to make changes in my forked repository and then make a pull request.

I primarily use RStudio, so I have enabled its integration with Git. I can make changes to my forked repository and then push, pull, sync, etc. The problem is that I still have an additional step of logging into GitHub and making a pull request for my forked repository. Is there a way of doing this from RStudio?

Upvotes: 6

Views: 2518

Answers (3)

Tripartio
Tripartio

Reputation: 2180

The usethis package has an entire category of functions dedicated to working with pull requests from R (with examples from RStudio). They have a nice vignette that explains how their functions carry out the pull request workflow. The vignette explains how, as the pull request contributor, you can:

  • set up your Rstudio, git, and GitHub environment for easy pull requests.
  • fork and clone the repository to which you want to contribute;
  • branch and then make your changes;
  • submit the pull request.

It also shows how things work from the side of the reviewer who considers whether to accept the pull request:

  • review the pull request;
  • merge and finish.

Upvotes: 1

MS Berends
MS Berends

Reputation: 5189

This could be done via the GitHub API, which could be executed from an R package using the httr or curl package, after which such a package could have an addin for RStudio, which would let you check everything using a nice Shiny app!

Now we only need to look for someone who wants to develop this… Can’t seem to find it (Jan 2022).

Upvotes: 0

Matthew Crews
Matthew Crews

Reputation: 4295

I too use RStudio for R development and I do not believe there is a way to do this. The reason is because this is more than just adding code to a branch, you're requesting a management feature to take place which is pulling part of your code into another branch of the code base. RStudio appears to be limited to pulling, syncing and committing. Likely you need to use a separate, more full featured GitHub client.

Upvotes: 2

Related Questions