Search code examples
iosgithubversion-controlxcode7

Xcode 7 created new branch, commit fails


Recently upgraded to Xcode 7 with an in progress app. Got app running fine but when I went to commit first changes in Xcode 7, I got the below error:

The working copy “App Name” failed to commit files. error: invalid object 100644 07ce6672fd469d5c7545e48b910cb3ff4508e9ca for 'App Name/App Name-Prefix.pch' error: invalid object 100644 07ce6672fd469d5c7545e48b910cb3ff4508e9ca for 'App Name/App Name-Prefix.pch' error: Error building trees

I then noticed that I now have an additional branch under Source Control in Xcode...one that says "Project Name - master" and one with just the Project name (no master). Previously, I only worked on a master branch since I'm working by myself. Does anyone know why this happened after upgrading to XCode 7? I've upgraded Xcode versions before with existing projects and never had this happen. More importantly, how do I resolve this?

Thanks!


Solution

  • After trying multiple solutions to this from other threads with no success, I was able to solve this with a very simple solution...deleted the xcode project locally and cloned the most recent git repository, then opened the project again in XCode. I dragged my unsaved changed files to the desktop first and then replaced them after cloning and all was well again. This solution may not work for everyone depending on the scenario, but it worked well enough for me.