I'm trying to ignore the xcuserdata folders that xcode 4 modifies and they keep come back despite being in my .gitignore file.
My .gitignore file as one line:
xcuserdata
Yet as soon as I change anything UI in xcode, I get this:
# modified: XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata/XXXX.xcuserdatad/UserInterfaceState.xcuserstate
I have done a...
git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata/XXXX.xcuserdatad/UserInterfaceState.xcuserstate
...and tried...
git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata
...followed by a commit. I have done this close to 10 times and it just won't go away and be ignored. It keeps coming back.
What am I doing wrong? There is clearly something I am not understanding. The file did get added to the repository when I first created it and now I'm trying to get rid of it.
I just want that file to become completely untracked like it had never been added to the repository.
After doing
git rm -r --cached XXXXXXXX.xcodeproj/project.xcworkspace/xcuserdata
check that git status
tells you that the files under that folder have been deleted. Then after your commit, ensure that git says there is nothing to commit.
The fact that you have done this "10 times" and it comes as modified shows that you are not doing it right and the folder ( actually the files within it) are still tracked.
Apart from that the content of the .gitignore
seems fine and I have even confirmed on my repo that it works.
If you can't push your commit just because UserInterfaceState.xcuserstate
has been modified, here's a quick fix:
f01a2147218d by username
)git reset --hard f01a2147218d
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With