简体   繁体   English

使用Xcode的Git,没有这样的文件或目录

[英]Git with Xcode, no such file or directory

I've been searching around and looking for answers but I haven't found something that works yet. 我一直在搜索并寻找答案,但是还没有找到有效的方法。 I apologize if this is easy and someone has already answered this as I'm new to Git. 如果这很容易,并且我已经是Git的新手,所以有人已经回答了这个问题,我深表歉意。

What happened was there was a branch both my coworker and I were using. 发生的事情是我和我的同事都在使用一个分支。 There was a conflict when I tried to commit (I honestly can't remember if it was committing or when I Pulled in her changes). 我尝试提交时发生了冲突(老实说,我不记得是在提交还是在进行她的更改时)。 Basically we were both deleting unused files, images, etc. I went through the conflicts and I thought I went through it properly accepting both of our changes, but something still might have gotten messed up because I'm getting 基本上,我们都删除了未使用的文件,图像等。我经历了冲突,我以为我接受了我们的所有更改都经过了正确处理,但由于我正在获取某些信息,所以还是有些混乱

No such file or directory

For a specific image. 对于特定的图像。 These are some of the things I tried, with cleaning and rebuilding after I have tried one of these which have not worked. 这些是我尝试过的一些事情,在尝试了其中一项无效的工作后进行了清洁和重建。

- Adding the image back to the project (Xcode still thinks its missing and doesn't update it's .xcodeproj)
- git reset HEAD <file>
- git add <file>

Nothing seemed to work. 似乎没有任何工作。 When I try git status, I saw that it is an untracked file. 当我尝试git status时,我看到它是一个未跟踪的文件。 I then removed it. 然后我将其删除。 I see my .xcodeproj is 我看到我的.xcodeproj是

$10 says the .xcodeproj doesn't recognize the existence of the image. $ 10表示.xcodeproj无法识别图片的存在。 Git does a very poor job of properly merging the .xcodeproj file, and you will often have to readd files due to a bad merge. Git在正确合并.xcodeproj文件方面做得很差,由于合并不当,您通常必须读取文件。

When in doubt, find a past version of your .xcodeproj that works, bring it to your master HEAD, and add the files that are missing from the .xcodeproj. 如有疑问,请找到可以使用的.xcodeproj的旧版本,将其带入主HEAD,然后添加.xcodeproj中缺少的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM