Is there a good tutorial where I can learn using git+dropbox together effectively?
Git is used for distributed version control. Dropbox is more of a filesync. I think if you can use git, then you dont need to use Dropbox other than for its cool drag and drop features. I don't really see a use for putting a git repository in a dropbox folder, other than for maybe working on the same code base and origin using two different systems.
I think that git on dropbox is great. I use it all of the time. I have multiple computers (two at home and one at work) that I use dropbox as a central bare repo. Since I don't want to host it on a public service and I don't have access to a server that I can always ssh to, Dropbox takes care of this by syncing (very quickly) in the background.
Setup is something like this:
~/project $ git init
~/project $ git add .
~/project $ git commit -m "first commit"
~/project $ cd ~/Dropbox/git
~/Dropbox/git $ mkdir project.git
~/Dropbox/git $ cd project.git
~/Dropbox/git $ git init --bare
~/Dropbox/git $ cd ~/project
~/project $ git remote add origin ~/Dropbox/git/project.git
~/project $ git push origin master
From there, you can just clone ~/Dropbox/git/project.git that you have associated with your dropbox account (or have shared this dir with people), you can do all the normal git operations and they will be synced to all your other machines automatically.
I wrote a blog post on my reasoning and how I set up my environment, it's based on my Rails development experience, but can be applied to anything, really.
Dropbox already retains old versions of files, so it makes for a weird match with git.
@Dan McNevin:
thank you for your interesting answer! Do you see any problems with having your repo in Dropbox and nowhere else? I don't want to pull and push always. All I want Dropbox for, is having a backup solution and being able to work from multiple computers. Help appreciated. Max
I don't think that using git and dropbox is the way to go... Just think about the features of both:
Git:
- Allows you to have a central repository;
- Allows you to have your own repository with your own changes;
- Allows you to send and receive changes from the central repository;
- Allows multiple persons to change the same files and them merges them or asks you to merge them if it can't do it;
- Has web and desktop clients to allow access to the central repository;
Dropbox:
- Keeps everything in a central repository;
- Allows you to have your own versions of the files in the server;
- Forces you to send and receive changes from the central repository;
- If multiple persons change the same files, the first file committed is replaced with later commits, and no merge occurs which is troublesome; (And definitely it's biggest disadvantage)
- Has web and desktop clients to allow access to the central repository.
And if your worried with sharing some of your files, why not cipher them? And them you could get the biggest advantage of dropbox to git, that is to have public and private files...
We use this method (creating a bare repository in Dropbox) on a share folder.
A small group of developers can pull from that bare synced repository and create a local clone. Once the unit of work is done, we push back to origin.
One thing I'm missing is a good way to have an e-mail sent with the change-set information once a push to origin occurs. We are using Google Wave to manually keep track of changes.