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

Re: the opposite of .gitignore, whitelist

From
Rafael Ascensão <rafa.almas@gmail.com>
Date
Oct 26, 2018, 13:28 UTC
Message-ID
<CACUQV5-t5NHwQMC0=TYZVmPT1NSQn_J+Nz+vj4jj9-b=pn9oTw@mail.gmail.com>
In-Reply-To
<87tvl8lw5d.fsf@evledraar.gmail.com>
One other option is to just use a pattern that matches everything, i.e:
    echo '*' > .gitignore
And take advantage that ignore rules do not apply to tracked files.
So instead of using an explicit .gitonly, you add files using:
   git add -f <file_to_be_included>
All files should be ignored except the ones that were forcibly added.
If needed, git ls-files can be used to list either category.

Cheers, Rafael Ascensão

Previous: Ævar Arnfjörð BjarmasonNext: Jason Cooper
Message 8 of 10 in “the opposite of .gitignore, whitelist”
  1. lhf635@163.comOct 25, 2018
  2. Junio C HamanoOct 25, 2018
  3. Jason CooperOct 25, 2018
  4. Jeff KingOct 26, 2018
  5. Mischa POSLAWSKYOct 26, 2018
  6. Jeff KingOct 26, 2018
  7. Ævar Arnfjörð BjarmasonOct 26, 2018
  8. Rafael AscensãoOct 26, 2018
  9. Jason CooperOct 26, 2018
  10. Jason CooperOct 26, 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.