iOS開發:告訴git不要跟蹤UserInterfaceState.xcuserstate

 

在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"
相關文章
相關標籤/搜索