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

Re: .gitignore vs untracked working file

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Aug 10, 2009, 11:41 UTC
Message-ID
<4A800785.8050909@viscovery.net>
In-Reply-To
<286817520908100317k4e98faf9n4e852b7abd4719fe@mail.gmail.com>
Rostislav Svoboda schrieb:
Show 11 quoted lines
> 2009/8/10 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
>> Hello,
>>
>>> $ git checkout master
>>> error: Untracked working tree file 'Project/bin/path/file.jjt' would
>>> be overwritten by merge.
>> What is the output of
>>
>>        $ git ls-files master bin/
> 
> Nothing:
It should have been
	$ git ls-tree master bin
> BTW the rule to ignore bin/ is exclusively in the .gitignore on the
> branch mybranch not in the master branch. Might this be the problem?

It might be, depending on how precious Project/bin/path/file.jjt is for you. Try this:

	$ git checkout -f master

This will overwrite the existing file with the version from master. If you later

	$ git checkout mybranch
then the file will be *removed*.
-- Hannes
Previous: Rostislav SvobodaNext: Rostislav Svoboda
Message 4 of 7 in “.gitignore vs untracked working file”
  1. Rostislav SvobodaAug 10, 2009
  2. Uwe Kleine-KönigAug 10, 2009
  3. Rostislav SvobodaAug 10, 2009
  4. Johannes SixtAug 10, 2009
  5. Rostislav SvobodaAug 10, 2009
  6. Johannes SixtAug 10, 2009
  7. Rostislav SvobodaAug 10, 2009

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.