0

This is happening and i can't understand why

User-MBP:Project user$ git status
On branch playlist
Your branch is ahead of 'origin/playlist' by 1 commit.
  (use "git push" to publish your local commits)
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
    modified:   Project/TPSettings.plist

no changes added to commit (use "git add" and/or "git commit -a")
User-MBP:Project user$ cat .gitignore
SubModules/
.DS_Store
Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate
Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
User-MBP:Project user$ 

The file is in the .gitignore so it shouldn't be telling me to commit the file.

Sascha Wolf
  • 18,810
  • 4
  • 51
  • 73
bruno
  • 2,154
  • 5
  • 39
  • 64
  • 1
    This is one of the most frequent questions on the [tag:git] tag, please ensure to properly search next time before asking a question. – Sascha Wolf Jul 02 '15 at 13:58

1 Answers1

9

This is happening because the files in question are already in source control. You can remove them with git rm --cached myFile.txt. After that, they will indeed be ignored. A word of caution, though: others who pull the repo after you have pushed your changes will have their local copies of said files deleted in their working directory, so they will probably want to make a backup first.

David Deutsch
  • 17,443
  • 4
  • 47
  • 54