Benzi Heler
Benzi Heler

Reputation: 1148

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.

Upvotes: 1

Views: 1568

Answers (3)

Xaxxus
Xaxxus

Reputation: 1859

Xcode is extra awful when it comes to source control. Every single thing you do is saved in the workspace folder so that when you log back in, its in the exact same state you left it.

If you are extra lazy (like me) you can add a global gitignore and never have to think about this again.

I still recommend using a repo-specific gitignore simply so that other people don't introduce crap into your repository, or god forbid someone overwrites your xcode theme/keybinds/etc...

Upvotes: 0

Benzi Heler
Benzi Heler

Reputation: 1148

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>         

Upvotes: 1

Joe
Joe

Reputation: 1368

If you want an easy way to ignore files, you can also use http://www.gitignore.io which helps create useful .gitignore files for your project.

Here is the emacs template: https://www.gitignore.io/api/osx,xcode

There is also documentation demonstrating how to run gi from the command line.

Upvotes: 0

Related Questions