Friday Session #2: Xcode and Source Code Management

Please note, this blog entry is from a previous course. You might want to check out the current one.

Between lecture #4 and lecture #5 the second Friday session addressed source control. It can be found on iTunes titled “Xcode and Source Code Management (October 7, 2011)”.

This lecture explains how to use the local source control functionality of Xcode, as well as how to add source control later on if you did not add it when you initially created the project.

If not added initially the git has to activated manually via the terminal. First change into your project directory, find UserInterfaceState.xcuserstate which you have to .gitignore because you do not want to add it to your repository as it changes practically by only looking at Xcode. e.g.:

cd Developer/Calculator/
find .
echo PATHWHERYOUHAVEFOUND/UserInterfaceState.xcuserstate .gitignore

Now init git, add your project and commit it. e.g.:

git init
git add .
git commit -m "Initial commit"

… all these steps are done automatically when you choose to use source control when you create a project.

All the functionality of committing, merging, branching, etc. can be accessed via “File” -> “Source Control”. Additionally you synchronize with external repositories using push and pull or create and restore previous snapshots of your code.


Leave a Reply

Your email address will not be published.