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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With