11

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!

Maxim.K
  • 4,120
  • 1
  • 26
  • 43

1 Answers1

1

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.

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • 2
    I don't experience any issues with Git+Dropbox combo, it is only when RStudio comes in, the said index.lock behavior appears. The answer could still be useful if you cared to elaborate (not my downvote btw). – Maxim.K Nov 25 '13 at 14:58
  • @Maxim.K: the problem seems to be when you're syncing a Git working copy, try to work with a bare repo instead – CharlesB Nov 25 '13 at 15:17
  • I don't use RStudio, but still encounter this problem. – Resigned June 2023 Jun 02 '17 at 21:13
  • 2
    I actually have a similar problem with OneDrive and R-Studio. I am continuously encountering sync failures on OneDrive because supposedly the lock_file is still in use. Oddly enough, I can't even find this file... but it only occurred since I started working with R Studio about 2 weeks ago. – Mario Niepel Dec 14 '20 at 02:27