0

I've got myself in a bit of a pickle. I followed standard instructions for renaming my project in Xcode 5 (just clicking the project name and renaming, and then doing the same for the only scheme I had in my project).

The problem is, I think I did it when I was on a branch that was NOT my Master.

So now, I have a branch that has had all changes committed and it works perfectly fine. If I go to switch to Master, I get the following message: "The file for the container that was at [DIR/project.xcworkspace] has disappeared. Do you want to re-save the container or close it?"

If I try to merge into Master, I get the same message.

How can I take this current branch that represents the app in its correct state and force it to become the Master so I can start from square one?

I already pushed this branch from local (it's called "qr-scanning-refactor") to my GitHub master. So I'm wondering if there's a way I can totally reset and have the GitHub master become my new Master in XCode?

Thanks!

ekimneems
  • 25
  • 5

2 Answers2

0

You could always remove the .git file and start again with git using the current state as the first commit. If this is not possible you will probably have to stash your changes, checkout master and change the relevant folders and commit them locally. Now checkout go back to your stash and try to merge it in. I would consider working locally and get everything in order, then make a new remote and push the changes up.

In general renaming anything to do with xcode is fraught with danger. Before you dig an even bigger hole, I would start making some archives if you haven't of your states so that you can recover if you get yourself into even more hot water. Renaming changes in Xcode demand making some backups on the spot because you can pretty much assume things will go badly. Good luck.

SmileBot
  • 19,393
  • 7
  • 65
  • 62
0

Before you proceed, make a copy of this project and store it somewhere.

You should use a git GUI like sourcetree to visual your current git status.

To reset your git project, do How to make Head point to master in git?

To rename your iOS project in the future, use https://github.com/ytbryan/rename

Community
  • 1
  • 1
ytbryan
  • 2,644
  • 31
  • 49