This article was originally posted here.
My previous post explained how to set up Subversion on your Mac using Versions. After some further experience with version control, I have come to the conclusion that a distributed version control system like Git is safer than a centralized one like Subversion.
Installing up Git on your Mac
To install Git, download the Git Installer for OS X. Once you have finished with that, you are ready to get started.
Migrating an existing SVN repository to Git
Prerequisites
This tutorial assumes that you have an existing SVN repository to migrate, and that you have set up your Git hosting (of course, it does not need to be hosted, but for collaboration, you will want some sort of hosting; my suggestion is to use Dropbox by following Cocoa Is My Girlfriend’s excellent tutorial here.
Housecleaning
When you use a version control system, it will litter your directories with information that is important, only so long as you are using that system. For instance, Subversion uses tons of .svn directories. Naturally, when you have content that has been in a Subversion repository, you will need to clean these out. Luckily, it just takes a few commands in Terminal:
svn co http://myrepositoryaddress/stuff Project
cd Project
mv trunk ~/development/Project
find . -name ".svn" -type d -exec rm -rf {} \;
Just like that, all of the useless Subversion directories are gone. Now you are ready to put make this project into a Git repository.
Managing your repository
Inside the directory you just cleaned, run the following command: git init. That should tell Git that this folder is meant to be a repository. When you are ready to commit your changes, just run git commit -a -m "description here".
Tools for Git on your Mac
There are a few graphical applications that support Git on that Mac, but none of them are anywhere near having the quality and ease of use that Versions has. The only tool I use for Git on my Macbook besides the Terminal is the open source GitNub, a Ruby-Cocoa application that views commits and changes.
Installing GitNub
GitNub comes as source, so you will need to compile it. Make sure that you are running Mac OS X Leopard and the developer tools installed. Then, open the .xcodeproj file and Build (⌘B) (make sure that you are on Release build mode). Then, move the executable in build/Release to /Applications. Finally, move the nub file in root of the downloaded directory to /usr/local/bin.
When you are ready to view your commits and look at changes, just run the `nub` command from your project directory.
Conclusion
Although GUI tools for Git on the Mac today are not as advanced as current Subversion tools, Git feels like a very powerful choice in the version control area.
                                   
