Xcode 5, Export Project to SVN repository - xcode

In previous version of Xcode there was a repository section in Organiser which is now missing in Xcode 5. How to export project to SVN in Xcode 5.

One way is using an svn client. The one which is obviously available is the command line svn client. So here's how I use it:
Our repository is: https://myserver.me.com/svn/
The repository is added to Xcode using Xcode->Preferences->Accounts.
Create a new project inside Xcode 5: $HOME/IOS/Projects/MyProject
Close the project or maybe even better close Xcode to avoid Xode interfering with svn. Really.
Open a terminal and change directory into the projects folder
cd $HOME/IOS/Projects
Import the project into svn:
svn import -m "New Import" MyProject/ https://myserver.me.com/svn/trunk/MyProject
Checkout the project again to create a working copy
svn co https://myserver/svn/trunk/MyProject MyProject
Re-open the project in Xcode and enjoy svn. The project is now part of the repo.

Select Source Control -> Check Out…
This shows a “Check Out” dialog.
Select SVN from Recents or Repositories tab.
Now, select the directory in which to check out the project.
Click on “Check Out”. This updates the local project to remote SVN.

please refer this.
https://developer.apple.com/library/ios/recipes/xcode_help-accounts_preferences/articles/add_repository.html#//apple_ref/doc/uid/TP40013306-CH4
and on click on setting btn you can import and export also.

In XCode 5, you can add/view repositories at Xcode->Preferences->Accounts. You can also view/enter the repository at "Source Control"->"Check Out..."

Related

Xcode Source control commit winow showing no files

I created a new project and try to commit it from source control tab. But the commit widow does not show any files.
It is possible that your project is not being tracked by git. To enable tracking, you need to open the project directory in command prompt and run following command -
git init
This will initialise git in your project repo and start tracking your files.

How to import git project into Xcode 8?

I have C++ make project on the git but I can't import it into Xcode. I clicked "check out an existing project" and then choose repo and enter username passwords then select branch and download path. At the end it opens folder of project then I clicked finish, thats it nothing happens.
When I open an empty project, I can see the git project on the "source control" tab but I can't import it. Can you guys help me?
Btw: I am deeply regret to buy mac.
To import a git repo into XCode 8 you just need to go to SourceControl -> Check Out...
There in the enter a repository location text field enter the full path of the git repository (e.g., https://github.com/your-log-in/repo-name.git
Then you will be prompt about where to save the local files, and you are good to go

Xcode crashes when working with repository

I have an Xcode project one local and one remote repository. Firstly, there was a problem in current version and I decided to change local repository's head using terminal. Xcode fetched everything and I continued working on the project. When I decided to commit changes, Xcode gave me an error like this: "error: src refspec (detached from ) does not match any.error: failed to push some refs to [repository address]". After, I decided to create a new remote repository and try to make initial commit of this project. I added remote to Xcode and now it crashes even if I open "remotes" tab. I use bitbucket as my remote repo.
Question: is it possible to fix this, or it is easier to copy all the contents of the project to another one and commit new one? Thanks for replies.
I had the same problem: the local git repo was created from command line (from terminal app) and not from within Xcode, Xcode would crash every time even when clicking on the remote tab. I have a different solution that may be easier:
1)Commit and Push all changes with your current project from your local Xcode-non-compatible repo
2) Re-open Xcode (close it if it's open) and select "Check out an existing project" from Xcode
*If you don't see this Xcode startup screen, go to Source Control->Check Out...
3)Select the remote repo then
4)Select a NEW directory for the checkout destination
Now you will have a project set up and compatible with Xcode!
Solved:
Create new empty project, then copy all the files from previous one. Create new repository, absolutely clean. Push there.
It seems that Xcode had a conflict when local repository's head was changed using command line and git. So, this is as warning for users who got the same situation.

Xcode 4: Source Control options grayed out (Git local repository)

When I set up a new project in Xcode 4, and select "Create local git repository for this project," all seems well enough. I'm able to commit files from the Organizer (it would appear.) However, in the Project Manager, the "Source Control" menu options (commit, etc.) are all grayed out, except for "Repositories" which of course just takes me to the organizer.
Furthermore, in the Project Manager window, I don't see any icons by file names indicating if they're changed, committed etc. like I see in the screenshots in the Xcode 4 documentation.
I've tried this with both a project that's connected to Github, and one that's just using a local repository, and I've still yet to see those options not be grayed out. Any suggestions?
I discovered the cause of this problem is that I was saving projects in /Developer.
Turns out, that's a big no-no. Not only does it break git integration in the way described in the original question, as well as breaking other features such as Xcode 4's refactoring functionality, it also runs the risk of deleting all of your work when you install an update. Once I started saving projects outside of /Developer, all the git functions in Xcode 4 started working as expected.
Bottom line: Don't keep projects in /Developer.
This can be a bit confusing. Apples documentation here:
http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/SCM/SCM.html
Has a great way to activate the source control via the command line:
To set up a Git repository from the command line . . .
Use the cd command to switch to your project folder, making it the current working directory.
Enter git init to create an empty repository.
Enter git add . to copy your project files into the repository.
Enter git commit -m "Initial commit." to commit all the files.

How would you avoid "Xcode, Subversion Error: 155007 (Path is not a working copy directory)"?

I am not able to see the commit option after I make changes to my working copy, but I ensured that my settings for svn were correct.
What exactly is the problem with this error message?
Xcode is showing:
Your path is not a working copy
What should I do to resolve this?
The blog post "Xcode, Subversion Error: 155007 (Path is not a working copy directory)" and its comment are pretty much the reference on this kind of error.
Simple Workaround:
Delete your local copy (cd myxcodeproject; rm -rf .)
Delete the “build” folder from the server
svn co https://svnserver/path/trunk/project .
Now you should see .svn folders in every directory of your local project (you don’t see them if you use the “Export” function of the SCM panel from Xcode).
At this point, you should be able to edit and commit your changes directly from Xcode.
Now you need to initialize correctly the project.
The following sections illustrate that part:
How to do it right (general principle)
To place the project under Xcode, you need to first import it.
The SCM->commit entire project… gives error 155007 if you don’t first do this:
Under the SCM menu in Xcode select Repositories, then click the IMPORT icon at the top of that dialog that appears.
Select the project from the list and then click the import button.
Of course you need to first configure at least one repository before doing the steps above.
Right Initialization steps (detailed process)
Create the project in XCODE.
Setup subversion in XCODE and select the subversion repository for this project.
Use Xcode SCM > Repository and click on the IMPORT icon. This will move the local copy to the subversion repository.
Now delete your local copy (or move it to another location just in case).
Finally CHECKOUT the project from subversion (this will create the subversion .svn folders, …).
Reselect the subversion repository for this project.
Commit the entire project.

Resources