Cannot remove file from “staging phase” in git
I am very new to git. What I did so far in it was this:
$git init $git add "folder/*.php"
Now, I cannot remove the php files from the staging phase... what it returns:
$git rm --cached "folder/*.php" fatal: 'folder/*.php' is outside repository
What do I do now? my git version is 1.7.1
First, the error occurs because those files are not added to the repository yet. When you do a git add, what git does is just to add files into a "list" that will be commit to the repository.
In order to "make these files part of the repository", what you can do is:
git commit -m "first commit"
git rm folder/*.php
Now since you remove files, you need to commit again to update git history about the remove.