Setting up Subversion with Xcode 4

In order to setup your Subversion repository from Beanstalk to work with Xcode, first you need to create a repository in Beanstalk. After you have created your repository, copy the URL to your Beanstalk repository URL to the clipboard.

Once you have copied the URL, you are ready to checkout the repository and to start using it in Xcode.

Setting up Xcode 4

To setup your Subversion repository in Xcode 4, go to File → Source Control → Manage Repositories. Once there, you will see an option to add a repository:

After selecting Add Repository option, you will need to enter your Subversion repository URL and the name you wish to add to your repository:

Click next, and on next step you should see an option to setup paths to your folders in your SVN repository. There are three folders which are usually created by default when you use SVN, and they are called /trunk, /tags, /branches. In case you don't have this folders, you can skip this step, it's optional.

The small red buttons should turn green if Xcode recognizes the folders, but don't worry if it doesn't, since it doesn't work correctly everytime in Xcode.

Once you have setup paths, connection to remote repository is setup, now Xcode will ask you for username and password of the repository (username/password which you use in your Beanstalk account), and after this you can checkout and use the repository. Please note that Subversion is case sensitive.

Sometimes, Xcode doesn't accept username and password as it should and you can't checkout repositories later. You could see an error like "Unable to load revisions". In case this happens, follow checkout this or this article which should help you solve this problem.

Now you should see in Xcode organizer your repository in the sidebar. What we would like to do is add one of our projects to Subversion so we can use version control for the project. We would like to add the project to /trunk folder of our repository. In order to do this, click on the /trunk folder, and then click on the import button.

When you click import, select the folder of files which you would like to import. Then you will be prompted to enter a commit message. After this, click refresh, and you should see the new files added to your repository.

Now your project is under version control, and you should be able to see it in your Beanstalk account, in your repository. All you need to do now is checkout the files to a location of your preference, and open the project from this location.

When you open the project, you will see flags next to all files you modify, add or delete and you will see an option to commit the files.

This allows you to do basic Subversion operations with Xcode, for more advanced Subversion features, we recommend using command line tools like Terminal.

Still need help? Contact Us Contact Us