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

Re: ignored file can be deleted silently

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
May 5, 2011, 14:18 UTC
Message-ID
<BANLkTi=C4pO83mT3pO0B_AMaK3RMOC4V8g@mail.gmail.com>
In-Reply-To
<BANLkTinEupQKfBofhH-qKD6gLGWyWRbGvw@mail.gmail.com>
On Thu, May 5, 2011 at 3:40 PM, Daniele Segato <daniele.bilug@gmail.com> wrote:
Show 5 quoted lines
> I noticed that when i put a file in the git ignore If i switch to a
> branch where the file is present and versioned git delete my local
> ignored file replacing it with the content of the branch I switched
> this is done silently and the file is gone forever if I don't have a
> copy somewhere

This is on purpose. Commit f8a9d42 (read-tree: further loosen "working file will be lost" check. - 2006-12-04) allowed ignored files to be overwritten. Perhaps we can have a config to tighten the check again?

-- 
Duy
Previous: Daniele SegatoNext: Junio C Hamano
Message 2 of 4 in “ignored file can be deleted silently”
  1. Daniele SegatoMay 5, 2011
  2. Nguyen Thai Ngoc DuyMay 5, 2011
  3. Junio C HamanoMay 5, 2011
  4. Daniele SegatoMay 5, 2011

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.