XCode Project files red after renaming project - objective-c

I have recently renamed my XCode project. In doing so, all my project files became red. Stupidly, I have re imported the project files and deleted the red files. Now, my XCode project will not run. Within 'products' the Appacus.app is still red and cannot be deleted.
How do I go about fixing a problem like this?
Appreciate any help,
Matt

Sure you are using versioning, right? Just go back in your git history.
git checkout <previous commit>
and try again.

You can use "git log" to check the previous version number. Follow by "git checkout " to revert back to last commit.
I am using this script to rename my iOS project. https://github.com/ytbryan/rename
After you rename it, remember to update your Xcode scheme too.

Related

Unable to add Newly Created Files to SVN

There seems to be a problem adding newly created files to subversion through Intellij, because when I right click on any of them, the option to add them is grayed out and only Revert is accessible:
By the way, this problem only appears with newly added files, the old ones are detectable and can be edited and committed without problem.
Maybe I missed something when I created them?
Any help would be appreciated. Thank you.
The solution was really simple. Here's how I did, hopefully this will help someone else one day:
Leave Intellij (or the IDE you're using) aside and open your command prompt.
CD to the root of your project.
Manually add the files that you have created with the command add.
Example: svn add path/to/your/file.java
Go back to Intellij, you should see all your files which weren't detected before change color from yellow to green.
You can now commit your new files.

How to delete version control log(history) from IntelliJ

I copied an existing Spring(java) project and started using this copy.
But, I found that Version Control Git history of the previous project exists in my project.
I tried to delete previous commit history, but I couldn't find how to.
Briefly, what I want to know is how to delete version control log(history) from IntelliJ.
Delete .git folder from your project.

IntelliJ: How to create a local Java project copy for backup?

I'm new to JavaFX 8 and the IntelliJ IDE. I have a JavaFX8 project that works but not as I would like. I'd like to try another approach but the substantial changes may not work. I don't want to loose code I have working.
To save code I have working, I've been creating a new project and then locally copying all the folders(.idea, out, src) and files except .iml, of the working project into the appropriate folders in the new project with the newly generated .iml.
This always seems to work but is it proper procedure?
I'm not on a team of developers and have yet to learn Git/GitHub.
Please advise. Thanks.
Maybe you should learn how to use a Version Control System like Git, then you can create a project repository and have different branches for things you want to try out. Keeping the working code in your master branch will prevent you loosing your working code. Also, when using a vcs you can always revert to versions of your code that have been working. The IntelliJ Idea IDE has perfect support for working with all different types of version control systems. If you don't want to learn any forms of vcs then there is no other way to "backup" your working code.
Is it proper procedure? It's probably not how most people would go about achieving what you want to achieve but it's certainly workable. If you wanted to stick with that for simplicity now, I'd copy the whole directory structure, delete the .idea and .iml files, and then create a new project in IntelliJ on that clean copy: IntelliJ will automatically set up folder structure based on the existing source without you having to go through any additional manual setup.
If you're willing to experiment with the git route, to achieve the basics of what you want to achieve is not very complicated and I've written a small quick-start below. IntelliJ offers very good support for Git, and once your repository is created you can do everything you need from the IDE. I'm going to assume you're working on Windows, although the steps shouldn't be too far removed on other platforms.
Install Git
You can download and install Git from https://git-scm.com/download/win, which will install a command shell called Git Bash.
One-off setup for your project
Open up git bash and go into the directory containing your source. Rather than seeing separate drives as Windows does, Git Bash assumes there is a logical 'root' directory under which all your files are accessible. Your C: drive will be /c. To move around you can use cd to change directory (using / instead of ) and ls to list files instead of using dir.
Assuming your source code is in C:\projects\myproject:
cd /c/projects/myproject
git init
The second line above creates a git repository in that directory. This doesn't affect your code, it just creates a folder called .git that contains all of the book-keeping information.
You don't want to have every file under version control - in particular you don't want your build outputs. You need to set up a file in your project directory called .gitignore which tells git which files and directories should be ignored. As a starting point you can copy https://github.com/github/gitignore/blob/master/Java.gitignore and rename the file to .gitignore
Basic Commands and committing your initial version
There are a small number of basic commands:
git status
Running git status will tell you which files have been modified, which are not under version control, and which files have been added to the staging area to be committed next time.
git add path/to/file
This adds a file to the staging area waiting to be committed. You can add multiple files to the staging area before committing them in one go.
git commit -m "description of your change"
This commits all of the staged files as a new version, which the specified commit message.
If you go into your project directory, do a git status and check through the list to make sure there's nothing you don't want to have under version control, then you can do git add . to add everything to the staging area and git commit -m "Check in initial version of the source code" to commit it to the repository.
After you've committed, you can run
git log
To see a history of all of the changes. IntelliJ has a view that will show you the same thing.
Creating an experimental branch
This is where git shines; if you want to try something experimental you can create a branch of your project while allowing git to preserve the original version.
git checkout -b experiment1
Will create and switch to a branch called experiment1. You can delete, rename, move, rewrite and develop whatever you like on this branch. The changes you commit will be independent of your original working version.
You can switch back to your original version (preserving all of the changes you've committed on that branch) using:
git checkout master
Where master is just the name of the default branch created when you ran git init. The experimental version will still be there and can be switched to again using git checkout experiment1 or from IntelliJ using the branch selection in the bottom right corner of the status bar.
If you decide that the changes you've made in experiment1 are to become your new "good" version, you can merge them back into the master branch and repeat the cycle from there.

XCode 6.0.1 error when creating project: The file "exclude" doesn't exist

When I create a new project in XCode 6.0.1, I got this error message: The file "exclude" doesn't exist
It seems to only impact the versioning of the files i.e. the generated stub files are not committed into github after the project is created.
What can cause this problem?
For me the issue was caused because I had previously created a project with the same name, and Xcode still had record of that.
To clear it out,
go to Window -> Organizer in the menu bar
Remove all of the repositories highlighted in red
To add your repository (if it's not being tracked for some reason),
Click the + (still in Window -> Organizer from the steps above)
Enter the path of your file
Make sure to change to Git from Subversion (if Xcode has Subversion set as default - it did for me.
I usually get this error if I initialize an Xcode project with a git repository, delete it and try to recreate it with the same name (casing doens't appear to make it sufficiently 'different'). Turns out, "Well I'll just start over" can leave some issues as well.
Hope this helps.
I had this issue as well, and I tracked it down to the .git-template folder included with Thoughtbot's dotfiles. Basically, Xcode expects its template folder to have info/exclude, and Thoughtbot's dotfiles don't. Creating that directory and file fixed the problem, as so (in the Terminal):
cd ~/.git_template
mkdir info
cd info
touch exclude
If you're getting this issue without Thoughtbot's dotfiles, you could probably look at ~/.gitconfig and use whatever templatedir is getting set as instead of ~/.git_template in the first command.

Make Xcode 5 follow history after git file rename

I am trying to figure out how to correctly rename files with git while using Xcode.
I made a test project, with a few commits, then renamed a file in Xcode, verified that the git status did say it was being renamed, and then committed outside of Xcode. This was in accordance with this answer to a SO question (Handling file renames in git).
I go back in to Xcode, try to look into the history of that file before the name change (in the version editor assistant window), and I get the error "This file does not exist in the index." While that is true, the file did not exist at that point, its predecessor did. When I go to the terminal, and run git log --follow myFile.m, I do see all commits, even those before the rename. So with that, the history is there, but Xcode doesn't seem to know how to find it.
How can you follow before a rename of a file in git version control when using Xcode?
PS. It does seem that the blame functionality can see before the name change, but the version editor can not.
I had the same error today and as suggested by matt
the best solution is to use an alternate Git GUI.
I finally solved this by installing the great GitX app by rowanj.
Then i saw the uncommitted change and simply commit it.
TY Xcode for being too git-simple and renaming-painful !