git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* "git rm" could be safer and have a better help msg
@ 2020-07-10 12:25 Tom Browder
  2020-07-10 12:33 ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Browder @ 2020-07-10 12:25 UTC (permalink / raw)
  To: git

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

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

end of thread, other threads:[~2020-07-10 22:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).