简体   繁体   中英

Git not ignoring some files extensions in my .gitignore file. Why?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM