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

Re: Bug in .gitignore handling

From
Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
Date
Mar 26, 2008, 20:27 UTC
Message-ID
<FDBA351C-54DE-406D-930C-7DCE0694A042@orakel.ntnu.no>
On 26. mars. 2008, at 21.01, Tommy Thorn wrote:
[...]
Show 11 quoted lines
> According to the man page, I should be able to change .gitignore to
> "foo/" to stop it from looking recursively, but that doesn't work, as
> now git clean -n -f -d wants to remove mydir/foo but not mydir/foo/ 
> objs
>
> My desperate attempts "./foo" and "^foo" also didn't work. Please note
> that this is a vastly simplified version of the real problem, so I  
> can't
> just use "!mousetrap/foo".
>
> It seems "foo/" _should_ work even though foo isn't a directory.

Have you tried "/foo"? That should match "foo" only in the root of the repository, which is what I think you're trying to do. "foo/" means to only match "foo" if it is a directory.

-- 
Eyvind Bernhardsen
Message 1 of 1 in “Re: Bug in .gitignore handling”
  1. Eyvind BernhardsenMar 26, 2008

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.