3

I'd like to use Git for a single-developer project, but how do I do backups using Dropbox?

There are actually a number of posts here discussing either Git for single-developer work or using Git with Dropbox with multiple developers, but the ones I saw did not address the single biggest concern:

If Dropbox backs up local `.git` repository while it is being modified, the repository could be left in a nonsensical, unrecoverable state.

To be clear, suppose I have a directory Working containing the git repository as a subdirectory .git. This is my main repository. From ~/Dropbox a symbolic link points to Working, thus backing up .git. I never push or pull anything: everything is local.

If I perform a local git commit on Working, which thus modifies .git, Dropbox might decide at just that moment to backup .git. If my machine crashed then, I would have a useless .git repository on the Dropbox server: I couldn't recover any files off it.

kdog
  • 1,583
  • 16
  • 28

1 Answers1

1

I always recommended to not use DropBox directly with a .git folder content: too many files which can potentially change too many times.

I proposed in "Backup a Local Git Repository" to use git bundle instead: that produces only one file (which acts as a git repo), and DropBox will have no issue copying it around.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250