tags:

views:

213

answers:

2

Hi, 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?

Thanks,

Zach

This is what is in my .gitignore file:

# xcode noise
*.mode1v3
*.pbxuser
*.perspective 
*.perspectivev3
*.pyc 
*~.nib/
build/*

# Textmate - if you build your xcode projects with it
*.tm_build_errors

# old skool
.svn

# osx noise
.DS_Store
profile
+4  A: 

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)
VonC
+1  A: 

.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
Hey, I did add that pesky file before I added it to the ignore file. I removed the file, and when I tried to commit a change, the file was not longer there, so your advice worked. Thanks guys.
agentbanks217
@Zach Banks I'd now mark one of these answers as accepted, so they get the credit and other users know the question is solved.
Edd