Git关于忽略Xcode工程中UserInterfaceState.xcuserstate文件的问题

1.打开终端(Terminal),进入项目目录下

Last login: Sun Aug 13 13:38:10 on ttys001

xilanglangdeMacBook-Pro:~ xinshaofeng$ cd /Users/xinshaofeng/Work/Found 

xilanglangdeMacBook-Pro:Found xinshaofeng$ ls

Found Podfile README.md

Found.xcodeproj Podfile.lock

Found.xcworkspace Pods

2.在终端输入:

git rm --cached [YourProjectName].xcodeproj/project.xcworkspace/xcuserdata/[ YourUsername].xcuserdatad/UserInterfaceState.xcuserstate

xilanglangdeMacBook-Pro:Found xinshaofeng$ git rm --cached Found.xcodeproj/project.xcworkspace/xcuserdata/xinshaofeng.xcuserdatad/UserInterfaceState.xcuserstate

rm 'Found.xcodeproj/project.xcworkspace/xcuserdata/xinshaofeng.xcuserdatad/UserInterfaceState.xcuserstate'

3.在终端键入  git commit -m "Removed file that shouldn't be tracked"

xilanglangdeMacBook-Pro:Found xinshaofeng$ git commit -m "Removed file that shouldn't be tracked"

[master fc0601e] Removed file that shouldn't be tracked

 2 files changed, 4 insertions(+)

 delete mode 100644 Found.xcodeproj/project.xcworkspace/xcuserdata/xinshaofeng.xcuserdatad/UserInterfaceState.xcuserstate

xilanglangdeMacBook-Pro:Found xinshaofeng$ 

4.重新打开Xcode commit, push

 

posted @ 2017-08-13 13:57  喜狼狼  阅读(891)  评论(0编辑  收藏  举报