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

Answers


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"

Then:

git rm folder/*.php

Now since you remove files, you need to commit again to update git history about the remove.


Need Your Help

How to pass data from a web page to another web page in a different project (JSF 1.1 - ADF 10.1.3)

java jsf oracle-adf

I've got two pages in two different projects (it means in different ear files that are deployed singularly) and i need to pass data from a page to another.

Different IP for each bot?

python web ip bots proxies

I'm doing a Python bot that will request an url under different IP addresses in one computer. Is there a way to change my IP address for free and apply it to the bot? I have looked around and it se...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.