How to use Xcode with a remote Git server

Step 6: Pulling from your remote

To bring your local working copy in sync with the changes that your coding buddies have made on the remote, select File – Source Control – Pull. A similar window will prompt you to select the remote from which you want to pull:

Screen Shot 2012-12-23 at 09.42.46

Click choose, Xcode will go a fetch the changes and bring your working copy up to speed. As I said before, if there are unresloved conflicts then this will be flagged at that point (but we’re not going to cover this here).

Step 7: Checking out a working copy (for your collaborators)

Your local system is sorted and ready for work – online and offline. But how about your collaborators? They still need a working copy of your code. Well, they all need to checkout (or pull) an initial working copy from your remote fist before they can start.

They would do that by heading over to the Xcode Repositories, and at the bottom left hand corner there’s a tiny plus sign. Click that and see the following window appear:

Screen Shot 2012-12-23 at 09.53.14

Your buddies can either choose to Add a Repository, or to Checkout/Clone a Reporisitory. The result is pretty much the same, however the latter will check it out and save it on the local system in one fair swoop. Select it to bring up a window asking for the location of the remote. In our example that was

gituser@mydomain.com/path/to/your/directory/Testing.git

Screen Shot 2012-12-23 at 09.56.37

Xcode will let you know if it can reach the host or if authentication is required and prompt for a password (our example URL is not working of course… you should see either a yellow or a green dot there).

Next Xcode will ask your buddy where he wants to save the project on his local disk and open the project. Now they have both a local and a remote repo and can commit, push and pull to their hearts’ content.

Just to summarize: your collaborators will need

  1. the URL to your remore repo
  2. and a set of SSH credentials to connect

Happy Hacking!





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices.

He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.