git .gitignore 檔案 解決二進位制檔案衝突問題

hhhker發表於2015-02-26

.gitignore  主要是新增 忽略檔案 。最近團隊開發經常出現 

UserInterfaceState.xcuserstate 衝突,開啟發現是二進位制檔案 ,沒法解決衝突。

只好 rm -rf 之,次數多了真煩啦。

一勞永逸解決方案:

1,找到 .gitignore 新增 UserInterfaceState.xcuserstate 不納入版本管理

2, 移除git 已經跟蹤的UserInterfaceState.xcuserstate  ,啟用.gitignore 忽略對應檔案

      1),git rm --cached YourProjectFolderName.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate

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

       3),git clean -f -d

http://stackoverflow.com/questions/6564257/cant-ignore-userinterfacestate-xcuserstate

推薦個 iOS 常用的 gist  :https://gist.github.com/mmorey/6931793

 

相關文章