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

Q: Ignore ./foo, but not script/foo

From
UWUlrich Windl <ulrich.windl@rz.uni-regensburg.de>
Date
Jul 19, 2018, 07:38 UTC
Message-ID
<5B503FF0020000A10002C6B5@gwsmtp1.uni-regensburg.de>
Hi!
I have a (simple) question I could not answer elegantly from the gitignore(5) manual page:

A project produces a "foo" binary in the root directory that I want to ignore (So I put "foo" into .gitignore) Unfortunately I found out taht I cannot have a "script/foo" added while "foo" is in .gitignore. So I changed "foo" to "./foo" in .gitignore. I can could add "script/foo", but now "foo" is not ignored any more!

Is there as solution other than:? -- foo !script/foo !bla/foo #etc. --

If "foo" is one exception to generally using foo elsewhere, it seems to be counterproductive to have to add exceptions for all the cases that are not exceptions, while "foo" is the only exception...
Did I miss something? If so, maybe add it to a future manual page.

Regards, Ulrich

Next: 3Ævar Arnfjörð Bjarmason
Message 1 of 6 in “Q: Ignore ./foo, but not script/foo”
  1. Ulrich WindlJul 19, 2018
  2. 3Ævar Arnfjörð BjarmasonJul 19, 2018
  3. Timothy RiceJul 19, 2018
  4. Konstantin KhomoutovJul 19, 2018
  5. Ævar Arnfjörð BjarmasonJul 19, 2018
  6. Antw: Re: Q: Ignore ./foo, but not script/fooUlrich Windl, Jul 19, 2018

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.