Re: [PATCH] git-rm: don't remove newly added file without -f

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 26 Mar 2007, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> writes:
> 
> > Given this set of commands:
> >
> >   $ echo "newly added file" >new
> >   $ git add new
> >   $ git rm new
> >
> > the file "new" was previously removed from the working
> > directory and the index. Because it was not in HEAD, it is
> > available only by searching for unreachable objects.
> 
> I am not sure if this is a problem, as the user asked it to be
> removed.  It somehow feels to me that the change (I am not
> convinced your patch should be called a "fix" rather than a
> "behaviour change") would cause more confusion.

I agree it would add to confusion.

It is well established that "git rm" also removes the file _in the working 
directory_.

If you don't want the file to be deleted, but only the corresponding 
entry _in the index_, use "git rm --cached".

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]