iOS:svn 忽略 xcworkspace、xcuserdata文件

来源:互联网 发布:算法 n=n-1 编辑:程序博客网 时间:2024/06/05 01:09

        说明:     

          project.xcworkspace说明:is a directory of files describing the workspace or projects. Although some of the answers here indicate it is unnecessary and should be ignored for source control, I don't agree, but it's going to be highly dependent upon how you use your environment. Generally, the contents of the project.xcworkspace directory contains the contents.xcworkspace data file, which lists the projects that are included as top-level entities in your project。

          xcuserdata说明:You can safely delete the xcuserdata directories. It basically contains personal settings like breakpoints, user interface layout, open files, automatic snapshots configuration and so on。

         结论:

         an xcuserdata directory, which contains each user's settings (should be ignored for source code controL), and xcshareddata, which is data shared by users who share a project, and should be under source control.

         in environments where you don't share workspaces, or where you use simple workspaces, you can ignore these as well, however in environments where you put related projects in the same workspace and share that configuration, you may well want to keep these.

        解决办法:

        1.svn设置忽略属性:

svn propset svn:ignore xcuserdata path/to/my/folder/MyProject.xcodeproj
        说明:If you want to ignore a directory files, you need to svn propset svn:ignore files on its PARENT directory, not the directory itself.
# your directory structure is this:# workingCopy# workingCopy/parent# workingCopy/parent/subfolder# to ignore subfolder do this:svn propset svn:ignore subfolder workingCopy/parent
       或者方式2:
1.cd ~/工程目录/工程名字.xcodeproj/project.xcworkspace/xcuserdata/用户名.xcuserdatad2.svn rm --force UserInterfaceState.xcuserstate [如果svn命令不能执行,请安装xcode中的命令行工具或用Spotlight查找svn所在]   svn update [可能需要]   svn commit -m "忽略该死的UserInterfaceState.xcuserstate"3.export EDITOR=nano [注释:这是bash下]4.svn propedit svn:ignore . [注意后面有个点号,代表本目录]5.第4步执行完了会弹出nano编辑界面,复制粘贴UserInterfaceState.xcuserstate后按Ctrl+X输入Y保存即可.6.输入svn status就发现不显示UserInterfaceState.xcuserstate了.证明修改成功.
      2.修改配置文件

global-ignores = *.o *.lo *.la .*.rej *.rej .*~ *~ .#* .DS_Store *~.nib *.mode* *.pbxuser CVS _*.java *.perspective .LSOverride *.xcuserdatad 
备注:

--第一种方法:提示svn版本问题,具体效果怎么样不确定;

--第二种方法:试了貌似不好用。

        

0 0
原创粉丝点击