Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore not working for xcuserdata directory in XCode project

Tags:

git

xcode

ios

This is my gitignore file:

# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/

However, it still detects changes here:

BW.xcodeproj/project.xcworkspace/xcuserdata/cooluser.xcuserdatad/UserInterfaceState.xcuserstate

This is on XCode 6.

What am I doing wrong?

Thanks!

like image 688
0xSina Avatar asked Sep 17 '14 20:09

0xSina


People also ask

What is Xcuserdata?

Files in xcuserdata are non-shared scheme data and UI configuration (e.g. UserInterfaceState. xcuserstate ). They are non-shared in that they belong to a user. Those settings are only read when you are the user.


1 Answers

The file BW.xcodeproj/project.xcworkspace/[...]/UserInterfaceState.xcuserstate must already be tracked by git.

When you add an entry to .gitignore it only affects untracked files. If they are already tracked, they are not automatically removed from the repository.

You can remove this file manually with: git rm --cached BW.xcodeproj/project.xcworkspace

like image 185
Kuhess Avatar answered Oct 22 '22 01:10

Kuhess