How to use Xcode with a remote Git server

- by

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

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!

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

2 thoughts on “How to use Xcode with a remote Git server”

  1. But what if I dont wish to make a new bare repository. Instead I wish to use the local .git file that is here: /%PROJECT FOLDER%/.git ?

  2. Hi Jaro,

    In that case, just head over to the Xcode Repository browser (in the Organizer) and click the little plus icon on the bottom left. You can add a local repository there.

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.