Before we start, make sure that you have Git and Dropbox installed on your computer.
-
Make Project directory a Git repository and commit Project.
$ cd ~/workspace/Project $ git init $ git add . $ git commit -m "The first commit of Project: Initialize the repository"
Now we have an .git directory which contains the reversion information under Project directory. -
Then switch to your Dropbox directory and create a new folder. Make a bare repository with Project in the folder created just now.
cd ~/Dropbox $ mkdir repository $ cd repository $ git clone --bare ~/workspace/Project Project.git
-
We can remove the Project under workspace directory now and get a clone from our Dropbox repository.
$ cd ~/workspace $ rm -f -r Project $ git clone ~/Dropbox/repository/Project.git
- Share your repository folder with your coworkers.
We have a distributed repository now. It's simple, right?
BTW, if you are not using Dropbox, you can try github, it's free for hosting open source projects.
Two configure files for Xcode projects that you may need. :-)
-
.gitignore
# old skool #.svn #.hg #CVS # Mac OS X noise *.DS_Store *.swp *~.nib profile # Xcode noise *.pbxuser *.perspective *.perspectivev3 *.mode1 *.mode1v3 *.mode2v3 # Xcode4 noise xcuserdata *.xcuserstate # Generated files MANIFEST build/ dist/ *.pyc *.[oa] # Textmate - if you build your xcode projects with it *.tm_build_errors
- .gitattributes
*.pbxproj -crlf -diff -merge
No comments:
Post a Comment