Showing posts with label distributed. Show all posts
Showing posts with label distributed. Show all posts

9/06/2011

How To Build A Distributed Git Repository With Dropbox

Version control is used commonly in software development. It's helpful and essential, especially in teamwork. There are may version control systems such as Subversion, hg, and VSS. Here I'm going to use Git which is powerful and easy to use with Dropbox to create a distributed repository.
Before we start, make sure that you have Git and Dropbox installed on your computer.
  1. 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.
  2. 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
    
  3. 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
    
  4. 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