git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: why is git destructive by default? (i suggest it not be!)

From
OGOlivier Galibert <galibert@pobox.com>
Date
Jun 24, 2008, 12:21 UTC
Message-ID
<20080624122122.GA57848@dspnet.fr.eu.org>
On Tue, Jun 24, 2008 at 11:29:43AM -0000, David Jeske wrote:
Show 10 quoted lines
> -- Jakub Narebski wrote:
> > If they are using '-f', i.e. force, they should know and be sure what
> > they are doing; it is not much different from 'rm -f *'.
> 
> Sure, no problem. I don't want the ability to "rm -f *". I'm raising my hand
> and saying "I don't want the power to do these things, so just turn off all the
> git commands that could be destructive and give me an alternate way to do the
> workflows I need to do". Just like a normal user on a unix machine doesn't run
> around with the power to rm -f /etc all the time, even though they may be able
> to su to root.

But you still have the power to /bin/rm -rf ~, which tends to have worse results. The root/user separation just tries to protect the system's integrity from the user. This is similar to git, whch tries to protect the repository's integrity, which is not the same thing as the contents.

--force exists because it is sometimes useful. It you block it behind some config setting, whoever is concerned will just change the config when he needs the command and never change it back. And windows, fsck and other things of the kind pretty much ruined the efficiency of confirmations before dangerous/destructive operations. So there isn't much left beside engaging your brain before using --force on a command.

  OG.
Message 1 of 1 in “Re: why is git destructive by default? (i suggest it not be!)”
  1. Olivier GalibertJun 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.