Some tips that may help when working with a git enabled Xcode project where it always wants to ignore your gitignore file:

  • Verify your .gitignore exists in the root git repository directory. This directory should be at the base of your project in most cases, and there should be an accompanying .git file. You can view hidden files on an OSX terminal session with ls -a.
  • Follow the steps (credit to Alin Huruba from a Stack Overflow posting) below from the root project directory. Note that any changes you have must be committed or they will be lost. For safety back up your project first

OSX

git rm -r –cached .
git add .
git commit -m “fixed untracked files”

Windows may differ with RM

git rm . -r –cached
git add .
git commit -m “fixed untracked files”

  • Make sure Xcode is closed. If it still wants to add ignored files, try Source Control -> Discard All Changes…, exit and repeat the git commands above.
  • Double check your .gitignore syntax. The github/gitignore has lots of good files to work against.

No Comments

There are no comments related to this article.

Leave a Reply

Your email address will not be published. Required fields are marked *