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

Re: 'untracked working tree files would be overwritten by merge' on ignored files?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2016, 17:06 UTC
Message-ID
<xmqqy467aeev.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160614160720.GA22675@inner.h.apk.li>
Andreas Krey <a.krey@gmx.de> writes:
> when I have an ignored file in my workspace, is git
> then also assumed not to remove it in the course
> of a merge?

IIRC, untracked files are kept during merge and across checking out another branch. Files that are deliberately marked as ignored by listing them to .gitignore mechanism are considered expendable, and they will be removed as necessary.

This is because we do not have the fourth-class, "we do not want to add them to the history as tracked contents, but we do not want to lose them", aka "precious"; we only have three, i.e. "paths in the index", "path that are untracked" and "path that are ignored".

Previous: Andreas KreyNext: Andreas Krey
Message 2 of 3 in “'untracked working tree files would be overwritten by merge' on ignored files?”
  1. Andreas KreyJun 14, 2016
  2. Junio C HamanoJun 14, 2016
  3. Andreas KreyJun 14, 2016

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.