質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Q&A

2回答

3726閲覧

UserInterfaceState.xcuserstateを無視することができない

pftyuk

総合スコア52

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

0グッド

0クリップ

投稿2019/05/30 14:30

編集2022/01/12 10:55

前提・実現したいこと

個人開発で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."

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

querykuma

2019/08/27 12:16

直す前に是非 git ls-files -vv git status の結果を追記してください。
guest

回答2

0

Qiitaでupdate-indexで直すケースが報告されているのでこちらが参考になるかもしれません。

手元でGitで管理されているファイルを.gitignoreに書いてgit rm --cached fileとすれば問題なく無視できたのですが。

git ls-files -vvの結果にSが付いているファイルがおかしくなるのかもしれません。

投稿2019/08/27 12:24

querykuma

総合スコア777

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

プロジェクト全体のキャッシュを消すと良いかもです

git rm -r --cached .

投稿2019/08/27 06:22

harumi

総合スコア407

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問