How to configure an xcode project to work nicely with SVN? - xcode

I'm just getting started with xcode. I created a sample new project, and would like to import it into my svn repository. I configured xcode to be aware of my repository, and xcode claims the it has successfully authenticated the connection.
I cannot, however, seem to figure out how to get my actual xcode project to manage its source in the repository. I select Project Settings -> SCM Repository -> "myrepository". But that doesn't seem to have accomplished anything. When I try to "commit entire project", xcode tells me: "/Users/me/Documents/test1" is not a working copy.
Any ideas? I'm probably missing something obvious, right?

Did you check out your subversion repository folder for your project to your local directory first?
If not, it's not really a working copy at all. A "working copy" is a local checkout of a repository folder, tracked using hidden .svn folders.
If you haven't checked out a repository folder, all you have is a folder. Subversion won't be able to handle that at all.
I suggest you read the Subversion e-book, and specifically the part about working copies.

Related

Exchanging source control from Git to SVN in Xcode

My project previously was in the Git source control (cloudforge.com). Now I want to exchange it to SVN source control. (Why not, my team members are not familiar/feel-comfort in Git). But when I want to checkout it already shows that it is yet in the Git source control.
I can't delete my project from git. It shows this error
But I have configured this project into svn by other Mac mini and able to checkout and commit.
My Question:
Why I can't checkout this project from this Mac as I can do it from other Mac?
OR
How can I delete my project from the first screenshot? Because there I can't find any option to delete.
Are you wanting to import your complete git repository into a Subversion repository, including history and log information? Or are you simply wanting to take a snapshot of your current project and make a Subversion repo out of it?
If you want to import the full history, then this may or may not be possible. Git supports branching/merging schemes that Subversion can't handle. It's only possible for fairly simple, linear project histories. See this other question for more details and options.
If you only want to move your current code snapshot into a different repository type, then the process should be relatively straightforward. All of git's metadata is stored in a normally-hidden folder in the root of your working copy named .git. Most IDE's flag a project as being connected to a git repository based on whether this folder is present and whether it has the expected contents. I'm not 100% certain about xcode, but here's what I typically do with other IDEs:
Make a copy of the working copy directory
Delete the hidden .git directory from the copy (plus any metadata files created by your IDE)
Import the copy into the IDE as a new project
At this point, your working copy will have no metadata and the IDE shouldn't associate it with any particular repository or version control system. You should now be able to import it into a Subversion repository using the same process that you would for a new project.

Xcode build folder appearing in svn

I am currently working on a project which is included in a versions(svn)repository. Although I'm not sure, I think I might have changed some settings in Xcode, affecting the way the source control saves the build folder in the repository. I was told it is a bad practice to commit the build folder, and asked why have I done that, but I had no answer at the moment. A screen will elucidate this more clear:
Even if I tried to delete (or ignore) those files from the repository, they are still created after I build the project. How should I proceed in order to prevent those build folders appear in versions' project tree?
Adding versioned folder to ignore-pattern does not affect data in SVN
You must ignore and remove folder from SVN, but keep it locally
For CLI it will be svn pe ... in the parent of build folder and svn rm build --keep-local (I don't know XCode GUI's equivalents)

How do I add Source Control to an existing project

How do I add Source Control to an existing project?
On some of my projects (originally created in Xcode3) I added Source control in Xcode4. I recollect there was an option to do this.
I now want to do similar for some old projects, but can find no way to do so.
I have searched and the only "solutions" I can find is to create a new project, and copy the original source files.
Unfortunately the way Xcode5 structures a new project is quite different, so this is not straightforward.
Is there a way to do this in Xcode5? I could probably do this in git, or even go back to Lion, but I am sure I am not the only person who wants to resurrect an old project.
Xcode doesn't have an option to create repositories for existing projects. You'll have to create a git repository from the command line. Launch the Terminal application, navigate to your project's directory, and run the git init command to create a git repository for your project.
If Xcode doesn't automatically recognize the repository you just created, open Xcode's Accounts preferences and add your repository from there.

Xcode: changing SVN repo details

This is about outdated repo details inside XCode. The case is:
I'm reusing a supporting library from an old project in a new one.
I used "Add files to X project..." functionality to copy them to the new place.
"Automagically" the files were copied with a reference to an old SVN repo, that don't exit anymore.
So... Now I have a project with 2 repos visible, incl. one inactive. I can't commit changes to copied files, as the old repo is still linked.
Two question here:
Is there a way to edit old repo data?
Is there a way to move the copied files to the new repo, where the rest of the project is?
Ultimately I need to commit both parts ;)
Thank you.
OK. So resolving this issues required several steps to be performed. Not sure if all were required, but the eventually I got it right.
Commit all changes you can (in my case all but the folder that was linked with the old repo). Archive your projects.
Go to the root folder of your project and use svn switch --relocate command to merge repos. Details: how to change svn settings
Remove the project from XCode (via Organizer) delete the entire project folder
Remove repos in the Organizer
Fetch whatever was committed in the SVN again. Do that and create a new project. If you see any missing files highlighted in red, like my folder that couldn't be committed, delete it.
Manually add the missing files / folder that to the project, from a local copy.
Now you can commit to the repo!
Tiresome, like most things in XCode... ;)

XCode 4.3 and SVN

I'm new to iOS developing, I haven't used earlier versions of XCode.
Yet I have stored my project on my local hd. Now I want to use some online subversion service.
I cannot seem to find the appropriate options in XCode. The hints that I googled all refer to a menu called SCM which I don't seem to have.
I created a new and empty repository online (webbased) and tried to configure XCode to use it by selecting the "Connect to a repository" menu when xcode starts. After some tweeking in the command line this "connect to a repository" succeeded but afterwards XCode simply closed itself again.
I tried copying the files that belong to my project to the path that I set up to be used with SVN manually. I opened the project in XCode from that path and after adding another file wanted to commit that change but couldn't find how to do that from within XCode.
Now I found that in XCode / Organizer / Repositories / MyProject is listed but has the type "GIT", which is wrong.
Do I have to change the repository type to SVN instead of GIT? If so, how can I?
When you created the project there was an option to put the project under source control. This option creates a git repository and is checked by default.
To use SVN you have to import your project into the SVN repository. (And you probably don't want it to be under git and svn at the same time, so you'll either delete the .git folder or recreate your project without the scm option selected.) Once the project is imported into your repository then you make sure Xcode knows about the repository and you can check the project out.
But really I'd recommend just using Git. It's a modern version control system with lots of nice features (though to do much of anything out of the ordinary requires using the command line) and there are nice project hosting sites for it like GitHub. I don't think SVN compares very well to git.

Resources