最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]Xcode中改动的User Interface State到底是什么意思

Xcode crifan 3623浏览 0评论

折腾:

[记录]Xcode中git merge branch到master上

期间,

想要去删除掉该状态

但是不确定这个:

User Interface State

是否包含了Xcode中的界面

去搜:

Xcode git User Interface State

参考:

xcode git 忽略user interface state文件 – xzc2677的专栏 – 博客频道 – CSDN.NET

ios – Can’t exclude user interface state from git in Xcode 5 – Stack Overflow

git – Can’t exclude user interface state from commit in xcode – Stack Overflow

xcode git 忽略user interface state文件 – 简书

但是我之前已经上传过了。

所以估计要是先去删除之前上传过的才行。

并且,此处本地已经添加和忽略:

UserInterfaceState.xcuserstate

了。

但是更先要知道:

到底此处的User Interface State是否包含图形用户界面

如果是,则是需要上传的。

但是根据那么多帖子,看来的确不需要保存和记录。

但是还是要去搞懂此文件:

UserInterfaceState.xcuserstate

搜:

Xcode UserInterfaceState.xcuserstate

what is UserInterfaceState.xcuserstate

Developer’s Note: 讓 Xcode 與 Git 合作愉快

“UserInterfaceState.xcuserstate 不要加入 Git Repository 因為它是 Xcode 產生暫時性的 Binary 檔。”

不能忽略UserInterfaceState.xcuserstate _Can’t ignore UserInterfaceState.xcuserstate_xcode_帮酷问答

UserInterfaceState.xcuserstate

svn – What is "UserInterfaceState.xcuserstate" file in xcode project? – Stack Overflow

去打开看看

JianDao/JianDao.xcodeproj/project.xcworkspace/xcuserdata/crifan.xcuserdatad/UserInterfaceState.xcuserstate

感觉的确像是:很多记录工程本事设置,布局方面的内容,和开发无关

所以的确可以去掉。

此处之前已经上传过,所以去删除掉:

 terminal中去执行:

licrifandeMacBook-Pro:iOS-Client crifan$ git rm –cached JianDao/JianDao.xcodeproj/project.xcworkspace/xcuserdata/crifan.xcuserdatad/UserInterfaceState.xcuserstate
JianDao/JianDao.xcodeproj/project.xcworkspace/xcuserdata/crifan.xcuserdatad/UserInterfaceState.xcuserstate: needs merge
rm ‘JianDao/JianDao.xcodeproj/project.xcworkspace/xcuserdata/crifan.xcuserdatad/UserInterfaceState.xcuserstate’
licrifandeMacBook-Pro:iOS-Client crifan$ 

结果回到Xcode中看到,标识已经变D了:

然后再去删除:

licrifandeMacBook-Pro:iOS-Client crifan$ git commit -m "Removed file UserInterfaceState.xcuserstate that shouldn’t be tracked"
[v1.0 f1762f7] Removed file UserInterfaceState.xcuserstate that shouldn’t be tracked
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 JianDao/JianDao.xcodeproj/project.xcworkspace/xcuserdata/crifan.xcuserdatad/UserInterfaceState.xcuserstate
licrifandeMacBook-Pro:iOS-Client crifan$

回到Xcode中,果然没了:

后来发现DS_Store也被之前存储了,所以也去删除掉:

licrifandeMacBook-Pro:iOS-Client crifan$ git rm –cached *.DS_Store
rm ‘.DS_Store’
rm ‘JianDao/.DS_Store’
rm ‘JianDao/JianDao/.DS_Store’
licrifandeMacBook-Pro:iOS-Client crifan$ git commit -m "Removed file all .DS_Store that shouldn’t be tracked"
[v1.0 c858990] Removed file all .DS_Store that shouldn’t be tracked
 3 files changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 .DS_Store
 delete mode 100644 JianDao/.DS_Store
 delete mode 100644 JianDao/JianDao/.DS_Store
licrifandeMacBook-Pro:iOS-Client crifan$ 

否则去Xcode的git中commit时,就会出现上述的界面,虽然没有文件更新,但是却还是Commit 1 File,实际上是就是DS_Store文件。可以通过点击文件看到。

转载请注明:在路上 » [已解决]Xcode中改动的User Interface State到底是什么意思

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.191 seconds, using 22.08MB memory