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

Re: No error when overwriting ignored files

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2021, 20:47 UTC
Message-ID
<xmqqzgy9yg80.fsf@gitster.g>
In-Reply-To
<2056254759.360640.1617825398727.JavaMail.zimbra@inf.utfsm.cl>
Horst von Brand <vonbrand@inf.utfsm.cl> writes:
> When pulling from a repository that tracks a file listed in
> `.gitignore` that would overwrite a local file, this is not
> reported.

Git has the notion of "not to be tracked (i.e. added to the index or committed) and expendable files", and they are called "ignored" files. And ".gitignore" and .git/info/exclude mechanism is used to mark these paths.

There is no notion of "not to be tracked but precious files" or mechanism to mark paths as such. So the behaviour you observed is fully expected and working as designed.

Thanks.
Previous: Ævar Arnfjörð Bjarmason
Message 4 of 4 in “No error when overwriting ignored files”
  1. Horst von BrandApr 7, 2021
  2. Jeff KingApr 7, 2021
  3. Ævar Arnfjörð BjarmasonApr 7, 2021
  4. Junio C HamanoApr 7, 2021

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.