1

In my .gitignore I have...

*.xcuserstate
*.xcbkptlist

However, whenever I open XCode and change anything, git annoys me telling me these have changed (which obviously they have)... but they are apart of my .gitignore... so why are they being flagged to begin with?

chris P
  • 6,359
  • 11
  • 40
  • 84
  • Were these files already staged when you modified the `.gitignore` file? Where is this `gitignore` file located? – Tim Biegeleisen Jun 29 '15 at 00:38
  • @TimBiegeleisen They've been apart of the committed project for some time as I didn't ignore these files when I started. The gitignore is alongside my .git and all project files locally. – chris P Jun 29 '15 at 01:01
  • You didn't answer my question. What does `git status` show you from the project root? – Tim Biegeleisen Jun 29 '15 at 01:04
  • @TimBiegeleisen Right now, because I've opened xcode and that's altered these files, they are under the not staged for commit. They typically get committed often though, as I might have 40 files during one commit, and instead of adding each separately, I do a wholesale add, commit, and push. – chris P Jun 29 '15 at 01:09
  • possible duplicate of [Ignore files that have already been committed to a Git repository](http://stackoverflow.com/questions/1139762/ignore-files-that-have-already-been-committed-to-a-git-repository) –  Jun 29 '15 at 04:07

1 Answers1

3

From the documentation for Git Ignore (emphasis mine):

The purpose of gitignore files is to ensure that certain files not tracked by Git remain untracked.

To stop tracking a file that is currently tracked, use git rm --cached.

Your Xcode Git plugin keeps telling you about the files in question because it is still tracking them. You need to do a git rm --cached <filename> on the file before adding it to .gitignore if you want the latter to take effect.

Community
  • 1
  • 1
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360