Adding files to an Xcode project (SVN) - xcode

I "checked out" an SVN repo. The repo contains a few Xcode projects and a workspace. I can open the workspace, build everything, run the app etc. If I make changes to any existing file they will be taken into account when building the app.
Now I want to add two new files to the workspace/project. I want to modify these files and when ready "commit" and "push" (I normally use git) the files to the repo. I added MyClass.h and MyClass.m to the Xcode project via right clicking on the appropriate group in Xcode and selecting "Add file to MyProject...".
The project won't build because MyClass.h can't be found. I also see a warning from the workspace that "MyClass.h is missing from the working copy".
How can I add files to an Xcode project under SVN version control?
I tried the suggestions here Xcode adding new files to existing project in svn but nothing works yet. For example when the files I just added to Xcode are selected the menu option "Add Selected Files" in the Source Control menu is greyed out.
I'm using Xcode 5.

As a work around, you can use smartsvn which has options for adding and removing files in Modify top menu

Related

Two different projects with the same name and GitHub

I have two projects, one is in the Documents / Android Studio / Project folder, the other project is in the Documents / XCode / Project folder. That is, in both cases the folder is called "Project". I added the Android Studio project from the Android Studio to Github and successfully tested it. The versioning system works as it should. Next, I decided to add a project from Xcode to GitHub. I added a GitHub account in the Xcode settings. Xcode showed the projects available for my account. Next, I try to add a project to Github by clicking Source Control - Create Git Repositories. Xcode reports that all projects are already under the control of the versioning system. If I click Source Control - Commit, it looks like Xcode offers to commit for all project files to the same online repository called Project, which stores the project from Android Studio. I don’t understand what to do, because it is not recommended to rename the Xcode project. How to resolve this conflict?
Just create a new github repo at github (browser) by some other name. Then follow the instructions for pushing your project to it in the Terminal using the command line. Do not use Xcode for this or any other git related stuff.

Automatically include newly added files when pulling from GIT

User 1: creates a new class and commit and push that to git.
User 2: does a git pull. newly created class file gets downloaded but not included in project. Has to right click and do "Include in project"
Is there a way to automatically include a newly added file while doing pull from git?
Do I need to commit any other file (.csproj/.sln) to solve this issue?
IDE: Visual Studio 2010
The project files, .csproj, keep track of which files are loaded in a project. So yes, you will also need to commit the updated project file to the repository in order for User 2 to have the file added to their project as well.
In my experience, even if Visual Studio is open, it will recognize the changed project file and ask if you want to reload it. When you reload it, your project should have the new file loaded.
As an aside, there is a great blog post on why you should get fetch/merge instead of pull

My XCode workspace doesn't remember added projects when restarted

I've added Google's GTL project to my project's workspace. It works fine, but every time I open XCode it disappears and I have to add it again. Why can't it remember this project? Is there a cache file or derived data I need to delete and rebuild?
Ensure that you are opening the .xcworkspace, not the .xcodeproj.
When you add the extra project to create a workspace the first time, XCode asks you to save a .xcworkspace file. This is is the file you have to open.

How to temporarily exclude files from being built

My project files are controlled by Perforce and I have installed the SCC plugin so that I can work directly with Perforce inside Visual Studio 2010.
Here is the problem I have:
Inside the project, there are several files that I don't want to take into consideration while I build the project. If I use the context menu "Exclude from Project", I saw the following warning message:
Checked out items cannot be deleted by your source control provider.
If you continue with the change, you may need to manually delete
xxx.‌h in the source control database.
Is there a workaround that I can use?
Thank you
If you simply do not want them to compile, select the code file and look at the Properties window. Set Build Action to content or some other non-compile setting.

Why is TFS ignoring a project in my solution?

I have multiple projects in our solution that is in our TFS 2010 repository. I've added about 5 new projects to this solution in recent days.
I have found that for one of the projects, that the project file itself will not check-in to TFS. All of the artifacts contained in this project are working fine; they are checked in and I can see them in the Team Explorer. But I cannot see the project file in Team Explorer, nor is their an icon next to the project in Solution Explorer that would indicate its checked in status.
Also, clicking on any of the TFS related option in the context menu in Visual Studio results in those options being applied to the file contained in the project, not the actual project itself.
Can this be remedied or do I have to create an entirely new project and add all of the artifacts from the old project back into it?
Your project doesn't have appropriate Source Control Bindings! With the solution open, you'll need to go to File -> Source Control -> Change Source Control to view the bindings for your projects. The failing one probably will show an "Unknown" or not binded status. You can then use that dialog to correct the binding and check in the project file.
Appended Alternate Solution -
Navigate to the Team Explorer -> Source Control and manually add the files using the "Add Items to Folder" menu item.
You can try following steps
1 Unbind the project in "Change Source Control" dialog
2 Refresh project to update source control status
3 Right click the project and click Add the Project to source Control in solution explorer
I was faced with the same issue but the solution is slightly different than those mentioned so far. My project's contents were checked in but the project itself was not. The project's bindings were valid.
In the Team explorer's Source Code Explorer, the project files were greyed out. After a get-latest, TFS opened the Merge Conflicts screen where I could choose to keep the local copy.
After this, the project was part of TFS.

Resources