[iOS development] Git can not ignore the.Xcuserstate solution

[iOS development] Git can not ignore the.Xcuserstate solution
Git

Will encounter this problem using Git in iOS development in peacetime, when in the.Gitignore file to add the.Xcuserstate ignored, after each push file changes will occur in the UserInterfaceState.xcuserstate file, here is the solution.


  • Open the terminal, CD to your project folder, and then enter the following command.
Git status
  • The UserInterfaceState.xcuserstate file is then changed, and the address behind the modified: is copied at this time.
[iOS development] Git can not ignore the.Xcuserstate solution
git status
  • Next, type in the address git RM –cached just copied, as follows.
Git RM --cached client_swift_fm_a/client_swift_fm_a.xcworkspace/xcuserdata/Jonzzs.xcuserdatad/UserInterfaceState.xcuserstate
  • Next, submit the code to the server.
"Git commit -m". Delete xcuserstate file "git push"
  • Then there will be no UserInterfaceState.xcuserstate file when it is submitted. It is important to note that the path is not mistaken, otherwise it will be reported wrong.

In the future, you will be grateful for the current self, and the development of their own readers and the road is infinitely better.

My portal: blogs, Jane books, micro-blog, GitHub.