Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single-developer Git with Dropbox backups: seeking safe, simple configuration

Tags:

git

dropbox

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.

like image 305
kdog Avatar asked Jul 17 '26 09:07

kdog


1 Answers

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.

like image 67
VonC Avatar answered Jul 19 '26 02:07

VonC