It is pretty simple, all you need to do is create the base repo in your dropbox folder and push your code. Here is a script that creates a new git project in ~/"new project" and initializes a git repo on your Dropbox folder (~/Dropbox/Git/"new project").