Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git, Dropbox and Rstudio

I use Dropbox to sync my RStudio projects across several machines. I also use Git to backup my code on an external site. Now, here is the issue. When I fire up RStudio, Dropbox goes crazy trying to index the file .git/index.lock. I have checked that that file appears and disappears from the .git subfolder of the project folder. It does so very rapidly, you have to hold the "Refresh" shortcut constantly to see it. As consequence, Dropbox uses up an entire CPU core, causing the CPU fan to spin at 100%. I have disabled syncing the .Rproj.user folder as described elsewhere in the FAQ, but this seems to be an unrelated problem.

Currently I must pause Dropbox manually to avoid wasting CPU and power, but it would be nice to find the reason behind this behavior. RStudio support has suggested to turn off the synchronization for the .git folder. I am not 100% familiar with Git, wouldn't this create conflicts when I make commits from different unsynchronized machines? Why does the index.lock file keep rapidly appearing? The mentioned support said that it is an issue between Dropbox and Git, not RStudio. Moreover, the problem occurs in some projects, but not others, and I cannot pinpoint the culprit. Thanks for any suggestions!

like image 942
Maxim.K Avatar asked Nov 25 '13 14:11

Maxim.K


1 Answers

Git and Dropbox don't play well together, at least with a working copy. It's fine if you have a bare repo in your Dropbox ; if you want to sync a Git repository between machines, prefer things like GitHub or BitBucket.

like image 93
CharlesB Avatar answered Oct 26 '22 15:10

CharlesB