[英]New files appear in red when checkout to another branch in git
It's obvious behaviour, when adding new files in a branch, then checking out to another branch, those files appear in red. 显而易见的行为是,在一个分支中添加新文件,然后签出到另一个分支时,这些文件显示为红色。 But I tried to remove them and they are definitely removed when gettig back to the original branch where they were created, so it seems it's not a good idea to remove them.
但是我尝试删除它们,并且在gettig返回创建它们的原始分支时肯定会将它们删除,因此删除它们似乎不是一个好主意。 So how to handle that since the Xcode is throwing that stupid compiling error.
由于Xcode会抛出该愚蠢的编译错误,因此该如何处理。 Thanx.
谢谢
This is not the obvious or correct behavior. 这不是明显或正确的行为。 Your project file is not checked into your Git repository.
您的项目文件未检入Git存储库。 Some people think this is a way to avoid conflicts but it's just a way to make your project not compile.
有人认为这是避免冲突的一种方法,但这只是使您的项目无法编译的一种方法。
git ls-files *.xcodeproj
Will show you if your project.pbxproj managed by Git. 会告诉您您的project.pbxproj是否由Git管理。
You fix this by manually fixing your build settings so every thing compiles and runs then checkin your project file. 您可以通过手动修复构建设置来解决此问题,以便编译并运行所有内容,然后检入项目文件。 You will need to do this in each branch.
您将需要在每个分支中执行此操作。 Your project file will not only have files that have been removed but missing files that have been added.
您的项目文件不仅会包含已删除的文件,还会缺少已添加的文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.