Xcode 7 created new branch, commit fails

人走茶凉 提交于 2019-12-20 06:09:30

问题


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!


回答1:


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.




回答2:


Use terminal to commit:

git init
git add -a
git commit -m "first commit"
git remote add origin https://github.com/truhoada/StackoverFlow.git
git push -u origin master


来源:https://stackoverflow.com/questions/33053917/xcode-7-created-new-branch-commit-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!