git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git rm --cached
@ 2007-11-02  2:17 Jing Xue
  2007-11-02 16:13 ` Remi Vanicat
  2007-11-11 14:05 ` Jan Hudec
  0 siblings, 2 replies; 10+ messages in thread
From: Jing Xue @ 2007-11-02  2:17 UTC (permalink / raw)
  To: git


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 <file>..." 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 <file>..." 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 <file>..." to unstage)
#
#       deleted:    1.txt
#
# Untracked files:
#   (use "git add <file>..." 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 <file>..." 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-11-14  8:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-02  2:17 git rm --cached Jing Xue
2007-11-02 16:13 ` Remi Vanicat
2007-11-02 21:41   ` Jing Xue
2007-11-03  9:39     ` Remi Vanicat
2007-11-04 17:04     ` Matthieu Moy
2007-11-11 14:05 ` Jan Hudec
2007-11-12  0:38   ` [PATCH] replace reference to git-rm with git-reset in git-commit doc Jing Xue
2007-11-12  2:27     ` Junio C Hamano
2007-11-12  4:43       ` [PATCH] RESUBMIT: " Jing Xue
2007-11-14  8:56         ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).