1. git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate  

  2. git commit -m "Removed file that shouldn't be tracked"  


然后在xcode commit的时候,UserInterfaceState.xcuserstate文件就会变成问号“?”状态,永远不要把它commit就可以了。