iOS Commit error in Xcode4

szymczyk

macrumors regular
Mar 5, 2006
173
9
The error message says the folder you added to the project isn't under version control so Xcode can't perform the commit. You can verify this in Xcode's project navigator. The files in the folder should have a - icon next to them.

The fix is to add the new folder to the repository. Open the Organizer and click the Repositories button at the top of the Organizer. You will see a list of repositories on the left side of the Organizer. Find your repository in the list. There should be several folders under the repository. If you don't see them, click the disclosure triangle next to the repository. Select the Trunk folder. Click the Import button at the bottom of the Organizer to add the folder to the repository.
 

mikezang

macrumors 6502a
Original poster
May 22, 2010
772
1
Tokyo, Japan
The error message says the folder you added to the project isn't under version control so Xcode can't perform the commit. You can verify this in Xcode's project navigator. The files in the folder should have a - icon next to them.

The fix is to add the new folder to the repository. Open the Organizer and click the Repositories button at the top of the Organizer. You will see a list of repositories on the left side of the Organizer. Find your repository in the list. There should be several folders under the repository. If you don't see them, click the disclosure triangle next to the repository. Select the Trunk folder. Click the Import button at the bottom of the Organizer to add the folder to the repository.
I tried to follow your advise, but it seems that I can finish it, I am not sure why.
 

szymczyk

macrumors regular
Mar 5, 2006
173
9
What happened when you imported the folder? Are there any icons next to the folder and its files in the project navigator? If the files in the folder have a - icon, there could be a problem with the import.

Can you commit the files from the command line? If you can, you know the problem's with Xcode and not your repository.

Can you commit other files in your project from Xcode?

I recommend filing a bug report with Apple. I have seen many complaints on Apple's paid developer forums about using Subversion with Xcode 4.

If you want to use Xcode's version control features, consider switching to git. Git can convert existing Subversion repositories to git repositories.
 

mikezang

macrumors 6502a
Original poster
May 22, 2010
772
1
Tokyo, Japan
What happened when you imported the folder? Are there any icons next to the folder and its files in the project navigator? If the files in the folder have a - icon, there could be a problem with the import.
one has a - icon, and some have A letter, they all show the same error message if I import them.

Can you commit the files from the command line? If you can, you know the problem's with Xcode and not your repository.
I am not so familiar with command line:(

Can you commit other files in your project from Xcode?
I can commit other files they added Subversion when I use Xcode3.

If you want to use Xcode's version control features, consider switching to git. Git can convert existing Subversion repositories to git repositories.
How can I use git for a exists project, can you show me the simplest way? Can I transfer exists Subversion revision to Git?

By the way, I am reading Pro Git...
 
Last edited:

szymczyk

macrumors regular
Mar 5, 2006
173
9
one has a - icon, and some have A letter, they all show the same error message if I import them.
Does the folder have an icon next to it in the project navigator? If it has a ? icon next to it, it's not part of the repository.

I can commit other files they added Subversion when I use Xcode3.
Can you commit other files in this project from Xcode 4? If so, you know the newly added folder is the problem.

How can I use git for a exists project, can you show me the simplest way? Can I transfer exists Subversion revision to Git?
The easiest way would be to run the git svn clone command from the command line. This command clones an existing Subversion repository into a git repository. A Google search for git-svn turns up many tutorials on running the git svn clone command.
 

mikezang

macrumors 6502a
Original poster
May 22, 2010
772
1
Tokyo, Japan
The easiest way would be to run the git svn clone command from the command line. This command clones an existing Subversion repository into a git repository. A Google search for git-svn turns up many tutorials on running the git svn clone command.
I will try it tonight.
One more detail question, my project is at /users/my user/my project/
Where do I run git svn? In folder above, or another new folder?
Though I know I can run git init in my project folder.
 

szymczyk

macrumors regular
Mar 5, 2006
173
9
Run the git svn clone command from the folder where you want the git repository to reside. Your project folder would be fine. Supply the URL of the Subversion repository to the git svn clone command. There's an example in Section 8-1 of the Pro Git book you said you're reading.
 

mikezang

macrumors 6502a
Original poster
May 22, 2010
772
1
Tokyo, Japan
Run the git svn clone command from the folder where you want the git repository to reside. Your project folder would be fine. Supply the URL of the Subversion repository to the git svn clone command. There's an example in Section 8-1 of the Pro Git book you said you're reading.
I am in folder /Users/mikezang/Documents/Projects/MyProject1/trunk/
and run command git svn clone file:///Users/mikezang/Documents/Subversion --no-metadata -s MyProjects
The result as below:
Initialized empty Git repository in /Users/mikezang/Documents/Projects/MyProject1/trunk/MyProjects/.git/

If I run git svn clone file:///Users/mikezang/Documents/Subversion --no-metadata
The result as below:
Checking out files: 100% (2732/2732), done.
Checked out HEAD:
file:///Users/mikezang/Documents/Subversion r516
creating empty directory: MyProject1/branches
creating empty directory: MyProject2/tags


and there is new folder where I run command, do I have to use source in trunk as below?
Subversion/
.git/
MyProject1/
branches
trunk
tags

I am not sure how to do next...
 
Last edited:

szymczyk

macrumors regular
Mar 5, 2006
173
9
I don't have access to your computer so I can't tell you exactly what to do. What I can tell you is the .git folder contains the git repository. The trunk folder most likely has your source code files, assuming you follow Subversion conventions.

A place to look for additional help is Stack Overflow. Look for the git-svn tag. There are over 700 questions with the git-svn tag, which means there's a good chance someone else had the same question you have and found an answer.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.