git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Tom Browder <tom.browder@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: "git rm" could be safer and have a better help msg
Date: Fri, 10 Jul 2020 16:04:34 +0200	[thread overview]
Message-ID: <874kqf1n65.fsf@igel.home> (raw)
In-Reply-To: <CAFMGiz8+pjskPpPqVgQUevKdWgxPvCKBcmx-07E2yizDqhm9mg@mail.gmail.com> (Tom Browder's message of "Fri, 10 Jul 2020 08:14:08 -0500")

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.

$ echo >> zlib.c
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   zlib.c

no changes added to commit (use "git add" and/or "git commit -a")
$ git rm --cached zlib.c
rm 'zlib.c'
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    zlib.c

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        zlib.c


Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2020-07-10 14:04 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 [this message]
2020-07-10 16:31       ` Tom Browder
2020-07-10 22:43       ` Aaron Schrab

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

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

  git send-email \
    --in-reply-to=874kqf1n65.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.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.
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).