简体   繁体   中英

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. So how to handle that since the Xcode is throwing that stupid compiling error. Thanx.

This is not the obvious or correct behavior. Your project file is not checked into your Git repository. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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