Monday, October 3, 2011

Xcode and git

If you are going to build enterprise applications you really need to use a good SCM.  I intend to look at how to integrate iOS apps within a larger application.  I have used SCM systems for more than 25 years and my current favorite is git.  I was using Hg before on a Java EE project but git has more and better tool support, IMHO.  I also love GitHub.

By default git will be used for any new Xcode project you create.  You have to uncheck the option during project creation if you don't want it. If you leave it checked Xcode will be create the default files for the project and it will do the initial commit.  After that you control the commits.  In this example I have added some code to the example in chapter 2 of Conway and Hillgras's book, iOS Programming, The Big Nerd Ranch Guide, 2nd  One way to access the git commands is via the File menu.

Xcode scm menu

Since I just added some code I want to do a simple commit. This brings up window shown below.  You can not complete the commit until you have added a comment.

XCode git commit screen

Note you can see the diffs of any file being committed.  Not a bad interface for commits.  I'll be commenting on other features of git integration as I use them.

You can also view the SCM repositories and see change history from the same File>Source Control menu.

List of Xcode Repositories

No comments:

Post a Comment