(note: in the examples below "$" is the bash prompt; all commands are entered in the OS X Terminal. I'm very much an old school UNIX command-line guy! However, on other platforms, all commands will be possible from your favourite git client.)
$ cd Project
$ git init .
$ git commit
Create a git server repository in Dropbox. It is initialised as "bare" which means it won't hold a working copy of the repository. It is a shared repository only.
$ git init --bare ~/Dropbox/git-server/Project.git
In the local repository, add the Dropbox repository as the remote origin then push the current branch up to it.
$ git push origin master
On another computer, to clone a copy of the project repository from Dropbox:
$ cd Project
$ git status
To update a clone from the Dropbox server:
$ git pull origin master
Too easy!
Some other useful commands for examining the remote repositories:
$ git remote show origin
And note that you can add other remote repositories. So you could add a github repository so you can selectively push stable snapshots of your project to github for public consumption, while keeping work-in-progress commits stored locally and backed up in Dropbox.
If you want a nice git GUI (before xcode4) try gitx. There's some better forks on github as the original hasn't been updated in a while.
ReplyDelete