Using Dropbox to synchronize files and having them backed up in version control

I’m using dropbox for random text notes (org-mode) and dot files that I bootstrap, namely

  1. part of my bash initialization
  2. emacs configuration
  3. vim configuration

Org-mode documentation suggests some backup in case of a mistake in editing folded sections. Makes sense. I also want backups in case I want to back out configuration change.

  • Git with Dropbox Issues
  • Is it possible to host a bare Git repository using Dropbox, to share code?
  • What does Git think a file's executable bit's value is?
  • Strange git error
  • Using git to Track changes to dropbox?
  • Quickly sync'ing git workspace across computers
  • There are tons of postings on why using git can break in dropbox.

    I see a few options:

    1. Not use dropbox and use bitbucket to host the files on git. The disadvantage is that when I switch machines, I have to remember to pull any changes, which is not convenient.

    2. I can use git via a chron job on one of my machines to backup the files in the dropbox folder and make sure that the git directory is not sync’d by dropbox. The disadvantage would be that this is a little asymetrical in that one machine has git on the dropbox files . However, the history is just for backup purposes rather than collaboration purposes.

    3. Not worry about the dropbox issues, as I infrequently commit changes and hardly do any other commands with the git repositories.

    4. Maybe a combination of #1 and #2. Occasionally push my changes to remote, having the .git directory not sync’d.

  • (yet another) modify git history to add a very first commit
  • Easy merging in svn using git-svn
  • git show old version of file in editor
  • Connecting GitHub to Shiny Server
  • Why can I not switch branches?
  • Duplicated folders in github
  • One Solution collect form web for “Using Dropbox to synchronize files and having them backed up in version control”

    You can use dropbox, just not for a full bare Git repo (because of the high number of files to synchronize and the risk for a corrupted repo if even one of those file doesn’t get sync properly, as shown in “Git ref master now empty, how to recover?”).

    I prefer to use dropbox in conjunction with a git repo bundle (ie one file):
    See “Git with Dropbox” and “Backup a Local Git Repository”.
    See a detailed analysis in this blog post.

    You can see an example of a script for that kind of task here (example by shtirlic (Serg Podtynnyi)):

    #!/usr/bin/env ruby
    if __FILE__ == $0
            bundle_name = ARGV[0] if (ARGV[0])
            bundle_name = `pwd`.split('/').last.chomp if bundle_name.nil?
            bundle_name += ".git.bundle"
            puts "Backing up to bundle #{bundle_name}"
            `git bundle create ~/Dropbox/backup/git-repos/#{bundle_name} --all`
    Git Baby is a git and github fan, let's start git clone.