From: Jing Xue Date: Fri, 02 Nov 2007 02:17:11 GMT Subject: git rm --cached Message-ID: <20071102021711.GA28703@fawkes.hq.digizenstudio.com> In the following scenario, why do I have to run 'git reset' following 'git rm --cached 1.txt' to revert to exactly where I was before 'git add 1.txt'? Shouldn't 'git rm --cached' have done that already? jingxue@fawkes:~/workspace/t1.git$ git status # On branch master # Changed but not updated: # (use "git add ..." to update what will be committed) # # modified: 1.txt # no changes added to commit (use "git add" and/or "git commit -a") jingxue@fawkes:~/workspace/t1.git$ git add 1.txt jingxue@fawkes:~/workspace/t1.git$ git status # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: 1.txt # jingxue@fawkes:~/workspace/t1.git$ git rm --cached 1.txt rm '1.txt' jingxue@fawkes:~/workspace/t1.git$ git status # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # deleted: 1.txt # # Untracked files: # (use "git add ..." to include in what will be committed) # # 1.txt jingxue@fawkes:~/workspace/t1.git$ git reset 1.txt: needs update jingxue@fawkes:~/workspace/t1.git$ git status # On branch master # Changed but not updated: # (use "git add ..." to update what will be committed) # # modified: 1.txt # no changes added to commit (use "git add" and/or "git commit -a") Thanks. -- Jing Xue