Roman Siro Roman Siro - 25 days ago 6
Git Question

Files created in one branch are shown in another in red as missing

I created some new files in my new branch and committed the changes. After I switch back to master branch , the files are in red marked as missing and it prevents to compile app. How to solve the problem. Thanks.

<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/SimpleCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/LevelSelectionCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/ShareButton.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/CalendarViewController.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/PostHeader.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/SeasonSelectionCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/LikeButton.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/AltitudeChartCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/ActiveLevelCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/LoadingFooter.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/PostCell.swift'
<unknown>:0: error: no such file or directory: '/Users/romansiro/Desktop/GOPASSApp/GOPASS/GOPASS/ChartView.swift'
Command /Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

Answer

Always make sure while committing your code you will always commit file project.pbxproj this is the file which contains the information related to adding a file, if you have not committed this file then you will get this error i.e. added files are missing.

Comments