在xcode中使用git管理项目的技巧:git
在多人协做开发的时候,每一个开发者都会在项目中的某个目录生成一个 UserInterfaceState.xcuserstate 文件,这个文件大概每5s会刷新一次,因此在push的时候总会提示有未提交的更改。xcode
在项目的 .xcodeproj包里的有一个 UserInterfaceState.xcuserstate文件;若是使用了workspace来管理项目,也须要让git对workspace包里的 UserInterfaceState.xcuserstate文件不跟踪。spa
找到你项目中全部的 .xcuserstate文件,使用如下命令便可,记得每一个成员都须要执行如下命令。code
下次在提交的时候,就能够看到这个文件的状态为 ? ,不要勾选。blog
& git rm --cached 这里支持全局路径/UserInterfaceState.xcuserstate
& git commit -m "Removed file that shouldn't be tracked"