No matter what I put in .gitignore
I can not get git to ignore the UserInterfaceState.xcuserstate
file below:
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
modified: CalFoo.xcodeproj/project.xcworkspace/xcuserdata/wcochran.xcuserdatad/UserInterfaceState.xcuserstate
I am using/editing the .gitignore
file listed on this post.
I tried everything to match the pattern including the exact pathname: CalFoo.xcodeproj/project.xcworkspace/xcuserdata/wcochran.xcuserdatad/UserInterfaceState.xcuserstate
to no avail.
This particular problem arises from the workflow where Xcode is used to create the initial git repo and the .gitignore
file from here is added afterwards. A more general answer to ignoring previously tracked files in git can be found from this question (I guess I never found this post in my search since it didn't have "gitignore" in the title).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…