From: Thomas Guyot <tguyot@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Gerriko io <gerriko.iot@gmail.com>,
git@vger.kernel.org
Subject: Re: Revert and reset and very damaging Git commands
Date: Mon, 11 Jul 2022 19:20:36 -0400 [thread overview]
Message-ID: <ba1eb825-89cf-84c0-864e-5307376ccba1@gmail.com> (raw)
In-Reply-To: <YsyYtOIpIU29OMN/@tapette.crustytoothpaste.net>
On 2022-07-11 17:40, brian m. carlson wrote:
> On 2022-07-11 at 19:52:05, Gerriko io wrote:
> Gosh this is not good.
>> Why are these commands bypassing all the fundamentals of a computer
>> OS. Surely if a file is deleted it should end up in the computer's
>> rubbish bin. Not deleted permanently without a trace.
> In general, the programmatic interfaces used to create and delete files
> don't use the user trash can. That's because many programs create and
> delete extremely large numbers of temporary files (Git included) and it
> would be silly to expose those to the user, since the user trash can is
> designed to handle files that the user specifically might want to
> recover. There is also no standard portable interface for placing files
> into the user trash can, while there are standard portable interfaces
> for actually removing files.
>
> Also, traditionally, on Unix systems, deleting files has happened
> without prompting, and Git is designed for Unix systems.
I'd like to add that in only very few cases git will remove untracked
files that haven't even been added to the index - for example git clean
-f (-f is force), as it's designed to remove untracked files.
In the case of reset, it could effectively wipe untracked files but only
if you reset to a revision that has these same paths, else it would not
touch untracked files at all.
Added files would however be affected but as pointed out earlier they
are already in your object store and can be recovered using git fsck.
If unsure about a command, especially with a name like "clean" or
"reset", all command are documented and the man page can be usually read
using:
git <command> --help
--
Thomas
prev parent reply other threads:[~2022-07-11 23:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 19:52 Revert and reset and very damaging Git commands Gerriko io
2022-07-11 21:40 ` brian m. carlson
2022-07-11 23:20 ` Thomas Guyot [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba1eb825-89cf-84c0-864e-5307376ccba1@gmail.com \
--to=tguyot@gmail.com \
--cc=gerriko.iot@gmail.com \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
/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).