Information Technology Reference
In-Depth Information
Xcode include author information with all commits, making it easy to see who is responsible for changes. You
can also update a project to refresh the version you're editing with the most recent changes without creating a
new copy.
NOTE
Git is a complex system with many features and options, but it's well documented. This chapter introduces Git in
Xcode, but it isn't a complete Git primer on collaborative development with GitHub. For full documentation, see
the free ProGit topic available at progit.org/book , the official command summaries at gitref.org , and the GitHub
help at help.github.com .
Using Git locally
You can use Git locally for simple project versioning. Simple versioning doesn't require a remote server, ad-
vanced Git skills, or command-line management, and it uses GUI features that are built into Xcode. This ex-
ample demonstrates how to create a local repository and how to use the Version Editor to review changes to the
files in a project. The edits in this sample project are trivial, but they're sufficient to illustrate how you can use
the Version Editor to manage code as you work.
CAUTION
The Xcode implementation of Git leaves out many of the features and concepts that are used when working with
the command line or with existing popular Mac Git tools such as GitX ( gitx.frim.nl ). For example, Xcode
doesn't support explicit file staging. If you've used Git from the command line in other contexts, you'll find that
the Xcode implementation is simpler and less powerful, but still adequate for basic SCM.
Creating a project with Git support
Git support is optional and available for both OS X and iOS projects. Use the File⇒New Project option in the
main Xcode menu to create a new project (this example uses an OS X project called LocalGit) and check the
Source Control box, as shown in Figure 14.5.
FIGURE 14.5
Creating a project with Git support
Search WWH ::




Custom Search