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

Re: Relative paths don't work in .gitignore as would be expected.

From
Stefan Beller <stefanbeller@gmail.com>
Date
Feb 2, 2015, 05:57 UTC
Message-ID
<54CF11CA.6000308@gmail.com>
In-Reply-To
<CAKU1PAWMh_3x9OoFmXG4+5b=7PRckC47k-MAq++SXahxAP5V7g@mail.gmail.com>
On 01.02.2015 14:51, /#!/JoePea wrote:
Show 11 quoted lines
> I have this in my .gitignore:
> 
>   ./*.js
> 
> I would expect that to cause git to ignore .js files in the same
> folder as .gitignore, but it doesn't do anything. However, this works:
> 
>   /*.js
> 
> I'm not sure what this actually means because a leading slash is the
> root of some filesystem, 

That's true, though you'd never (barely?) git version control an entire file system?

A trailing "/**" matches everything inside. For example, "abc/**" matches all files inside directory "abc", relative to the location of the .gitignore file, with infinite depth. (from man gitignore, though reading that and not finding a './' it may need improvement

Previous: /#!/JoePeaNext: Junio C Hamano
Message 2 of 5 in “Relative paths don't work in .gitignore as would be expected.”
  1. /#!/JoePeaFeb 1, 2015
  2. Stefan BellerFeb 2, 2015
  3. Junio C HamanoFeb 2, 2015
  4. Stefan BellerFeb 3, 2015
  5. Junio C HamanoFeb 3, 2015

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.