git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Tom Browder <tom.browder@gmail.com>
To: git@vger.kernel.org
Subject: "git rm" could be safer and have a better help msg
Date: Fri, 10 Jul 2020 07:25:29 -0500	[thread overview]
Message-ID: <CAFMGiz97fcw_nvaa=Xo-roTtB1o25qO06=PHGSrBzv4k_zGqaw@mail.gmail.com> (raw)

I often need to remove a file from Git but leave it as is, changed or not.
The only safe way to do that as far as I know is:

    $ git rm -f --cached myfile   # many thanks to @jast on IRC #git

The "git help rm" command yields copious information but nowhere can I find
a clear statement about safely removing a modified file from Git without
removing it from the file system.

I am going to create an alias to help me, but I believe the brute force
removal should be a different option, say, '-F' ('--Force'), and the
existing '-f' ('--force') ought to be safe operations as far as the file
system is concerned.

Best regards,

-Tom

             reply	other threads:[~2020-07-10 12:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 12:25 Tom Browder [this message]
2020-07-10 12:33 ` "git rm" could be safer and have a better help msg 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

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='CAFMGiz97fcw_nvaa=Xo-roTtB1o25qO06=PHGSrBzv4k_zGqaw@mail.gmail.com' \
    --to=tom.browder@gmail.com \
    --cc=git@vger.kernel.org \
    /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).