git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-rm isn't the inverse action of git-add
@ 2007-07-02 18:09 Christian Jaeger
  2007-07-02 19:42 ` Yann Dirson
  0 siblings, 1 reply; 37+ messages in thread
From: Christian Jaeger @ 2007-07-02 18:09 UTC (permalink / raw)
  To: git

Hello

I'm coming from cogito. There you can run:

  cg-add $file ; cg-rm $file

and everything is as before; it adds the file to the directory
index/cache, and just removes it again from the latter.

Whereas with git,

  git-add $file; git-rm $file

is giving the error

  error: '..file..' has changes staged in the index (hint: try -f)

And sure enough, git rm -f $file will remove the file from the index,
but also unlink it from the directory. (Ok, I did remember that cogito's
-f option is unlinking the file, so I was cautious and didn't try it on
an important file, but still...)

Turns out that

  git rm  -f --cached $file

will do the same action as cg-rm $file.

Why so complicated? Why not just make git-rm without options behave like
cg-rm? (Or at the very least, I'd change the hint to say "try -f --cached".)

Christian.

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

end of thread, other threads:[~2007-07-14 10:14 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 18:09 git-rm isn't the inverse action of git-add Christian Jaeger
2007-07-02 19:42 ` Yann Dirson
2007-07-02 20:23   ` Christian Jaeger
2007-07-02 20:40     ` Yann Dirson
2007-07-02 20:54       ` Matthieu Moy
2007-07-02 21:05         ` Johannes Schindelin
2007-07-03 10:37           ` Matthieu Moy
2007-07-03 12:09             ` Johannes Schindelin
2007-07-03 13:40               ` Matthieu Moy
2007-07-03 14:21                 ` Johannes Schindelin
2007-07-04 20:08                 ` Jan Hudec
2007-07-05 13:44                   ` Matthieu Moy
2007-07-05 14:00                     ` David Kastrup
2007-07-08 17:36                     ` [RFC][PATCH] " Matthieu Moy
2007-07-08 18:10                       ` Johannes Schindelin
2007-07-08 20:34                         ` Matthieu Moy
2007-07-08 21:49                           ` Johannes Schindelin
2007-07-09  9:45                             ` Matthieu Moy
2007-07-13 17:36                             ` Matthieu Moy
2007-07-13 17:41                               ` [PATCH] More permissive "git-rm --cached" behavior without -f Matthieu Moy
2007-07-13 17:57                                 ` Jeff King
2007-07-13 18:53                                   ` Matthieu Moy
2007-07-14  3:42                                     ` Jeff King
2007-07-14  0:44                                 ` Jakub Narebski
2007-07-14  6:52                                 ` Junio C Hamano
2007-07-14  7:16                                   ` Junio C Hamano
2007-07-14 10:14                                     ` Matthieu Moy
2007-07-02 21:20       ` git-rm isn't the inverse action of git-add Christian Jaeger
2007-07-03  4:12         ` Jeff King
2007-07-03  4:47           ` Junio C Hamano
2007-07-03  4:59             ` Jeff King
2007-07-03  5:09               ` Junio C Hamano
2007-07-03  5:12                 ` Jeff King
2007-07-03  6:26                   ` Junio C Hamano
2007-07-11 12:20     ` Jakub Narebski
2007-07-11 18:56       ` Jan Hudec
2007-07-11 21:26         ` 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).