18

When developing packages in RStudio.
By default RStudio assume your package directory is the project directory and it looks like that:
enter image description here

But you are allowed to point the package location to a subdirectory of the project directory and it looks like that:
enter image description here

This way you can have some part of your project files, kept in the root project directory, not included in the package. You don't need to set git ignore etc.

But if you want to add RStudio git repo features, you are not allowed to point your git repo in subdirectory, even if you have already created git repo in your package dir (not project dir) you cannot set it in RStudio. I'm stuck at:
enter image description here

Is there any way to enable git repo features in RStudio having git repository in the subdirectory of the RStudio project? Maybe some .Rproj config tweaks?

jangorecki
  • 16,384
  • 4
  • 79
  • 160

1 Answers1

6

Very good question. I've experienced the same trouble and it also does not go away with the latest pre-test release. So there's likely no super quick solution to this inside rstudio. Though it might be worth a feature request.

Personally I use the console / git bash with git and rstudio. That is I create a project inside R studio and manually run git init outside rstudio. Also I add, commit, merge, push and pull outside rstudio. If you don't like to manage git via console there's https://windows.github.com/ and https://mac.github.com/ also the folks at Atlassian provide some GUI tool called source tree: https://www.atlassian.com/software/sourcetree/overview Plus there are many others, like Tortoise Git which I haven't tested, but I think R Studio's current git support is fine for simple things, but a git tool (console or gui) is definitely the way to go if you want to be more flexible.

That being said, sublime text edit is a powerful and easy to hack and customizable text editor which also has quite some packages to extend it. It's not entirely free but sometimes it's a nice supplement to rstudio. And it has a cool resolve conflict package etc.

Matt Bannert
  • 27,631
  • 38
  • 141
  • 207
  • 1
    I'm currently doing exactly the same as you. And I even prefer git console over GUI versions :) But sometimes - preview file history, diff, etc. - it is easier using the RStudio. – jangorecki Mar 23 '15 at 23:35