Reputation: 52438
.Rproj.user/
is causing spamming on each git commit e.g.
modified: .Rproj.user/CE897349/sources/prop/238F1188
modified: .Rproj.user/CE897349/sources/prop/3B42583E
modified: .Rproj.user/CE897349/sources/prop/6FD5F454
modified: .Rproj.user/CE897349/sources/prop/B1FA156F
modified: .Rproj.user/CE897349/sources/prop/CA32C405
modified: .Rproj.user/CE897349/sources/prop/INDEX
These 'changes' don't seem important, e.g.
{
"cursorPosition" : "19,0",
"scrollLine" : "12",
"tempName" : "Untitled3"
}
How did I get this directory in the first place, can I delete it (and preferably not have it return or appear in future projects)?
Note: the project is an R package.
Upvotes: 22
Views: 12508
Reputation: 29
You can rename a folder like that to something else (or move it to another folder) and then see if it causes problems. (.e.g, .Rproj.user => .Rproj.user.HIDE or move it to a subfolder /HIDE ...).
I just did that with one of my projects, and when I re-opened the project, the previously opened files were gone. I would have to load them.
When I copy the file back (and had to delete the new hidden version that was created during my test) and then restart the project, my RStudio session re-opens with the last set of files I was working on.
In both cases, the data seemed to be intact.
My issue is that that file is large, and I want to make a backup, but really only care about the source files. (Can't use GitHub in my work environment either.)
Upvotes: 0
Reputation: 606
.Rproj.user is a hidden directory where project-specific temporary files (e.g. auto-saved source documents, window-state, etc.) are stored.
If you delete it, you will not access to your history or these temporary files. Your project will still work - Rstudio will recreate the directory when you open the project.
https://support.rstudio.com/hc/en-us/articles/200526207-Using-RStudio-Projects
Upvotes: 4
Reputation: 726
As written on the official Rstudio page, the .Rproj.user
stores some «project-specific temporary files (e.g. auto-saved source documents, window-state, etc.)». In other words, this directory is created along any R Project you make.
These files contain information related to some project options, such as:
I have configured my ~/.gitconfig
file to have this directory always ignored when I start a local git repository. For how to do that, please look at this answer on StackOverflow. In other words: it's completely safe to have it ignored in your .gitignore
file.
As far as deleting the directory is concerned, I never tried it. I guess it will get rid of any custom setting for your projects, perhaps reverting to default ones.
Upvotes: 14
Reputation: 874
I have the same problem with dropbox, and it seems that You can simply delete it. However You may lose your saved environment, but then You can just run everything from start again
Upvotes: 3