git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Tom Browder <tom.browder@gmail.com>, git@vger.kernel.org
Subject: Re: "git rm" could be safer and have a better help msg
Date: Fri, 10 Jul 2020 18:43:35 -0400	[thread overview]
Message-ID: <20200710224335.GB1346@pug.qqx.org> (raw)
In-Reply-To: <874kqf1n65.fsf@igel.home>

At 16:04 +0200 10 Jul 2020, Andreas Schwab <schwab@linux-m68k.org> wrote:
>On Jul 10 2020, Tom Browder wrote:
>
>> If the existing file has been modified, with 'rm'  the '--cached'
>> option doesn't remove it from Git
>> unless one uses the '-f' option with it.
>
>It doesn't?  Worksforme.

It needs to be forced iff the cached version doesn't match either what's 
in HEAD or on the file system. So when there's potential to lose work 
similar to other situations which require specifying a force option.

     $ git rm --cached a
     error: the following file has staged content different from both the
     file and the HEAD:
         a
     (use -f to force removal)

      parent reply	other threads:[~2020-07-10 22:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 12:25 "git rm" could be safer and have a better help msg Tom Browder
2020-07-10 12:33 ` Andreas Schwab
2020-07-10 13:14   ` Tom Browder
2020-07-10 14:04     ` Andreas Schwab
2020-07-10 16:31       ` Tom Browder
2020-07-10 22:43       ` Aaron Schrab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200710224335.GB1346@pug.qqx.org \
    --to=aaron@schrab.com \
    --cc=git@vger.kernel.org \
    --cc=schwab@linux-m68k.org \
    --cc=tom.browder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).