Can't ignore UserInterfaceState.xcuserstate

git管理 iOS 代码,经常出现ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate

解决办法:

To stop tracking a file that is currently tracked, use git rm --cached.

Use this, replacing [project] and [username] with your info:

git rm --cached [project].xcodeproj/project.xcworkspace/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"

Alternatively you can use the -a option to git commit that will add all files that have been modified or deleted.

Once you’ve removed the file from git, it will respect your .gitignore.

首先切换到.xcuserstate上层目录,使用上述命令即可,

ps:文件夹路径可以直接使用 tab 键

引用自:https://stackoverflow.com/questions/6564257/cant-ignore-userinterfacestate-xcuserstate

你可能感兴趣的:(iOS)