UserInterfaceState.xcuserstateを無視できません 質問する

UserInterfaceState.xcuserstateを無視できません 質問する

Xcode 4 プロジェクトのバージョン管理に Git を使用しています。 を明示的に追加しましたProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate.gitignore、Git はそれを無視しません。なぜそうなるのか、何か考えはありますか?

ベストアンサー1

Git はおそらくすでにファイルを追跡しています。

からgitignore ドキュメント:

現在追跡されているファイルの追跡を停止するには、git rm --cachedを使用します。

これを、[project]およびを[username]自分の情報に置き換えて使用します:

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

あるいは、-aオプションを使用してgit commit変更または削除されたすべてのファイルを追加します。

ファイルを git から削除すると、 が尊重されます.gitignore

おすすめ記事