Post

3 followers Follow
0
Avatar

Using RStudio projects AND Git with multiple users

I read this article: https://support.rstudio.com/hc/en-us/articles/201751487-Sharing-a-Project-with-multiple-users which describes how RStudio projects can be configured to share with multiple users. I have two questions about this:

1) Does this mean there will be no issues with saving code files if two users are working on the code files at the same time? Or does it only mean that multiple users can access the project files (but not at the same time)?

2) What if the project also has a local Git repository? Will two users working on the project at the same time be able to commit to the repository at the same time as well? 

I know that usually there would be a remote repository and users would clone the repository to their own machines and have separate .Rproj files, but I am wondering about a situation where a remote repository is not possible, and several users can access an RStudio project on a shared network drive (maybe, but not always, at the same time).

Thank you! 

Kathleen McLean

Official comment

Avatar

Hi Kathleen,

1) Under this configuration it is possible for two users to have the project open at the same time. However, it is not advisable for them both to be working on the same code file at the same time, because every time a user saves the file, the other users will see a prompt indicating that the file has been changed externally. This is likely to be annoying. :-)

2) Yes, but to do this you need to be careful about the permissions. Sharing a git repo among multiple users can cause problems because the files in the .git folder wind up with a mix of owners. Here's a post with more detail: https://serverfault.com/questions/26954/how-do-i-share-a-git-repository-with-multiple-users-on-a-machine

Although it's possible to have users share the local copy of the repo, it is not preferable. It is likely that you can set up a remote repository no matter your constraints; in fact, git can work with a "remote repository" that's nothing more than a folder on a shared network drive. See this article for details:

https://git-scm.com/book/ca/v1/Git-on-the-Server-The-Protocols

Finally, you might be interested to know that our just-released version of RStudio Server Pro includes project sharing features that take care of file permissions for you and offer collaborative editing (so you can in fact have two or more people actively editing the same file). More on that feature here:

https://support.rstudio.com/hc/en-us/articles/211659737-Sharing-Projects-in-RStudio-Server-Pro

Hope this helps!

Jonathan.

 

Jonathan McPherson
Comment actions Permalink

3 comments