XCode 4.3 and SVN - xcode

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.

Related

Xcode 8: how to add a GIT repository to an existing project

When I created this Xcode (Swift) project I forgot to check "Create Git repository". I spent many hours getting the first part of the project working and then realized I can't do a GIT commit. Is there some way to correct that oversight? IOW is there a way to change an existing Xcode project to include a GIT repository?
Usually I make a GIT commit right at the beginning but I obviously forgot to do that.
I'm not going to spend the time to learn GIT command line commands. If that's what it would take I'll instead make a new project that includes a repository and copy everything into it from the existing project. I've done that before but it's not quite as simple as it sounds.
Check if you have enabled Source Control in your existing XCode project.
Xcode > Preferences... > Source Control: check the Enable Source Control box.
That will give you access to Git menu commands.
For a full tutorial (XCode only, not git command line), see "Using Git with an existing XCode project" (answer starting with "Xcode 7 (and 8)")
The OP RobertL adds in the comments:
that answer misses one thing, namely that it puts only one file into the repository, not all of the project files.
If you make a change in every file in the project and commit again they all get into the repository.

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.

How to add existing Xcode project to git version control in Xcode?

It's clear how to add an existing project to GitHub outside of Xcode, there are a number of tutorial: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
There are also a number of tutorial of how to create a new project in Xcode under version control.
However, there are no tutorial on how to do both: add an existing project with the controls within Xcode. Is this even possible? Or since I already started the project, I'll have to do it all via command line?
Since you didn't ask Xcode for a local git repository inside this project folder when you created the project, you will have to create one via the command line.
After that, you can use Xcode's internal GUI to give git commands in your project - if that's the kind of thing you really want to do (personally I abhor Xcode's git interface).

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.

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

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.

Resources