Above The Gods
Above The Gods

Reputation: 175

Xcode is not respecting a gitignore entry

I have a file called Authentication.plist in my Xcode project and added it to my .gitignore file. However, I can't stop it from being committed to git automatically when doing so via the xcode source control menu. Is there a more effective way to ensure it doesn't get committed?

Xcode project navigator showing the file staged

Screenshot of the .gitignore list

Upvotes: 1

Views: 396

Answers (2)

Saurav Sahu
Saurav Sahu

Reputation: 13934

Use command git rm --cached Authentication.plist to untrack the file.

Upvotes: 3

matt
matt

Reputation: 535138

The problem is that Xcode's git support sucks. It's probably not even seeing that .gitignore file (you didn't say which one it was, global, user level, repo level, etc.). Your best bet is to turn Xcode's git support off altogether and use SourceTree or the command line. Or, you can at least reduce some of Xcode's automatic behavior:

enter image description here

Notice that I've unchecked "Add and remove files automatically". That will at least help work around this kind of annoying behavior.

Upvotes: 1

Related Questions