Git not ignoring certain Xcode files in .gitignore

I am new to Git and I am using it to backup an iPhone project I am working on.
I have added a list of files that Git should ignore (xcode files) when I update, but this .perspectivev3 (which is in my .gitignore) file keeps showing up when I go to commit my changes. Does anyone know why this is, or what I am doing wrong?


  • GCommit doesn't work with fugitive.vim under windows xp?
  • Git “Fetch URL” and “Push URL”, whats the difference?
  • Gitosis and ssh keys - does the email address have anything to do with the git email address?
  • Is it possible to use winmerge to view git diffs from cygwin?
  • Git is failing to push in puttycyg because of SSH error
  • Gerrit Trigger on multiple SCM in jenkins not working
  • Zach

    This is what is in my .gitignore file:

    # xcode noise
    # Textmate - if you build your xcode projects with it
    # old skool
    # osx noise

  • How can I find an unreachable commit hash in a GIT repository by keywords?
  • Best practices for using git in website deployments
  • A Git Source Control strategy for a live Sitecore website
  • Are git commands supposed to be run under the working directory directly?
  • gitolite: can connect via ssh, can't clone
  • mysqldump schema only, schema update without drop
  • 3 Solutions collect form web for “Git not ignoring certain Xcode files in .gitignore”

    If it keep showing up in the git status, it must have been added or committed before.

    You need to

    • git rm --cached that file, in order for the git status to not list it anymore (it is was just added, but not committed yet).
    • git rm that file, if it was previously committed (see this question for instance)

    You can use

    $ git rm --cached ./whatever1.txt

    after something is already under version control.

    In fact, if you have “whatever1.txt” under version control and you want to remove it from git, but leave your working tree undisturbed, then just do this:

    $ git rm --cached ./whatever1.txt
    $ echo /whatever1.txt >> ${PROJECT_ROOT}/.gitignore
    $ git status   # this will now show ./whatever1 as "deleted" (from git, not your working tree, and will show gitignore as modified or created)
    $ git commit -a

    And that’s it.

    Only use

    $ git rm

    when you want to remove the file from both the working tree AND the git repo.

    CAVEAT: The likely scenario you would use this is for removing IDE-specific files from git. In this example “whatever1” represents your IDE file(s) you’re removing. If you are working on a project with several people and you push this changeset to a shared repo, then their “./whatever1” files WILL BE DELETED when they pull this changeset. The easy thing to do from here for the people on the receiving end is:

    $ git checkout 1215ef -- ./file-you-want-to-restore ./another-file ./another-etc

    (where 1215ef represents the last commit before the deletion)

    This has the effect of restoring those files that were present at their last commit before the pull. After they have done this those files will be safe and not show up as uncommitted b/c they will fall under the exclusion of gitignore.

    Good luck!

    .gitignore only applies for untracked files. If you’ve git-add’ed files that are otherwise untracked due to .gitignore, they will still be part of the repository.

    Simply remove the files from the repository you don’t want anymore:

    git rm *.perspectivev3
    Git Baby is a git and github fan, let's start git clone.