It took me lots of time and many emails to a friend to fully understand how to do git branching from the command line. I love the command line as I’ve been using UNIX for 20+ years now. However, when I’m working in an integrated development environment like Xcode, it irks me to have to drop out to Terminal to handle revision control. I finally worked out the steps to branching/merging within Xcode, and thought others might benefit from the steps as well.
First off, bring up the organizer’s repositories view and find your project on the left hand side. Click on the yellowish folder labeled Branches inside of it and then at the bottom of the window click on the Add Branch graphic. Give the branch a name in the dialog that appears, and be sure to select the checkbox at the bottom to Automatically switch to this branch.
Back in the organizer, if you click on the blue folder representing your cloned project you’ll notice in the upper right part of the window Xcode will tell you that you’re now on your newly created branch.
At this point go back into Xcode’s editor and make all of your changes. Once you’re done, and you’re ready to push this branch up to the server, go to
This is where it got tricky, at least for me. You can’t do your merge operation now. Git wants you to be in the branch you’re merging to, not the branch you’re merging from. To accomplish this go back into the organizer’s repository view and click on your blue folder again. At the bottom of the window you can select Switch Branch to go back to your master branch (or whichever you want to merge these changes into). Now go to
Once you’re satisfied with the merged changes, just commit and push this back up to the master.