-2

I'm starting to use Git and for this project one file is appearing when I use git status.

enter image description here

I couldn't add it in .ignore file.

There is any way to not have when I use git status?

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
Leandro
  • 19
  • 5
  • Why can't you add it to .gitignore? (also, why haven't you added .gitignore to your repo?) – Paulw11 Feb 01 '18 at 02:30
  • Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Feb 01 '18 at 13:38

2 Answers2

1

The .gitglobalignores file in my home directory includes these lines:

xcuserdata
project.xcworkspace

Go ye and do likewise, and the problem will be solved.

matt
  • 515,959
  • 87
  • 875
  • 1,141
1

The problem here is that you've already committed the xcuserstate file, so it doesn't matter whether you add it to .gitignore. You need to remove it from the repo to make it be ignored in the future. You should also add the .gitignore file.

git rm -r --cached Quizzler.xcodeproj/project.xcworkspace/xcuserdata
git add .gitignore
git commit
rob mayoff
  • 375,296
  • 67
  • 796
  • 848