前提・実現したいこと
個人開発でGitを利用しています。
iOSの開発をしているのですが、UserInterfaceState.xcuserstateというファイルが
頻繁に出てくるため、非常に煩わしいのでこちらを管理対象外にしたいのですが
調べた手順を試しても、一向に消えなくて困っています。
ignoreファイルに記載してみたり、キャッシュを消してみたのですが
解決しないため、解決方法をご存知の方がいらっしゃいましたらご教示お願いします。
発生している問題・エラーメッセージ
[プロジェクト名].xcworkspace/xcuserdata/[ユーザ名].xcuserdatad/UserInterfaceState.xcuserstate
上記のファイルを、管理対象外にしたいが管理対象から外れない。
該当のソースコード
gitignore
1# Xcode 2# 3# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 5## Build generated 6build/ 7DerivedData/ 8 9## Various settings 10*.pbxuser 11!default.pbxuser 12*.mode1v3 13!default.mode1v3 14*.mode2v3 15!default.mode2v3 16*.perspectivev3 17!default.perspectivev3 18xcuserdata/ 19 20## Other 21*.moved-aside 22*.xccheckout 23*.xcscmblueprint 24 25## Obj-C/Swift specific 26*.hmap 27*.ipa 28*.dSYM.zip 29*.dSYM 30 31## Playgrounds 32timeline.xctimeline 33playground.xcworkspace 34 35# Swift Package Manager 36# 37# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38# Packages/ 39# Package.pins 40# Package.resolved 41.build/ 42 43# CocoaPods 44# 45# We recommend against adding the Pods directory to your .gitignore. However 46# you should judge for yourself, the pros and cons are mentioned at: 47# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48# 49# Pods/ 50# 51# Add this line if you want to avoid checking in source code from the Xcode workspace 52# *.xcworkspace 53 54# Carthage 55# 56# Add this line if you want to avoid checking in source code from Carthage dependencies. 57# Carthage/Checkouts 58 59Carthage/Build 60 61# fastlane 62# 63# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 64# screenshots whenever they are needed. 65# For more information about the recommended setup visit: 66# https://docs.fastlane.tools/best-practices/source-control/#source-control 67 68fastlane/report.xml 69fastlane/Preview.html 70fastlane/screenshots/**/*.png 71fastlane/test_output 72 73# Code Injection 74# 75# After new code Injection tools there's a generated folder /iOSInjectionProject 76# https://github.com/johnno1962/injectionforxcode 77 78iOSInjectionProject/ 79 80UserInterfaceState.xcuserstate
試したこと
gitignoreにUserInterfaceState.xcuserstateを追加した
以下コマンドを試した
Command
1$ git rm --cached 自分のプロジェクト名.xcodeproj/xcuserdata/自分のアカウント名.xcuserdatad/UserInterfaceState.xcuserstate 2$ git commit -m "removed cache."
直す前に是非
git ls-files -vv
git status
の結果を追記してください。