As far as I know, git-remote-dropbox is the only safe way to host a Git repository on Dropbox. Read about why here.
Once it’s installed, using Dropbox as a Git server is as simple as adding it as a remote: git remote add origin dropbox://path/to/repo. After that, it’s just the usual git pull and git push for interacting with the remote repo. (Source)