I have recently set up a git repository on bitbucket, and have added an old project onto it. I have committed and pushed a change as a test, but now I face this problem.
Step 1:
git rm --cached ProjectName.xcodeproj/project.xcworkspace/xcuserdata/username.xcuserdatad/UserInterfaceState.xcuserstate
Step 2:
git commit -m "Removed file that shouldn't be tracked"