Search code examples
xcodegitgitignore

Source control - Ignore files when committing on Xcode


There are some files (like the break points list file -xcbkptlist) that keep on emerging when i commit my code to a branch in Xcode source control. I have tried to use git ignore in the following way:

I've Opened up TextEdit and add the following:

build/*
.DS_Store
*.xcuserdatad
*.xcbkptlist

I Saved the file in the root directory of my project and named it .gitignore but the files still emerged.


Solution

  • All i needed to do make it work:

    1. Add the git ignore file to the project tree.
    2. Remove the file that i don't want to be committed, commit , and add the
      file again.( those files you ignore are still being tracked)

    Another way is to remove them from git manually using:

        git rm --cached <files>