git .gitignore 文件 解决二进制文件冲突问题

.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

 

原文地址:https://www.cnblogs.com/DamonTang/p/4300911.html