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

Re: Excluding files from git-diff

From
CJChristian Jaeger <christian@pflanze.mine.nu>
Date
Oct 17, 2008, 16:30 UTC
Message-ID
<48F8BDA7.50901@pflanze.mine.nu>
In-Reply-To
<48F8ACC2.1010903@drmicha.warpmail.net>
Michael J Gruber wrote:
> your .gitignore probably doesn't change that often,
> so that it shouldn't show up in the diff after that anyways. Or put it
> in .git/info/excludes.

For me, adding entries to that file does not make "git diff" or "gitk" or even "git ls-files" ignore files matching the entries. Only "git ls-files --others --exclude-from=.git/info/exclude" will exclude them. And "git diff " and gitk don't seem to know the --exclude-from option.

Is there a way to really invert the patterns given to "git diff" or alike? I.e. instead of saying "git diff -- * .somedotfile .someothernongitignoredotfile" one could just say something like "git diff --invert-matches -- .gitignore"? And even better, could one configure some such so that it has effect on all tools by default?

(That would help working around the clutter problem from the "Separating generated files?" thread; i.e. in some cases this could be good enough to not require splitting a project into multiple repositories. (Although I'm all the same currently working on a "intergit-find-matching-commit-in" script, since there may be more good reasons than only the clutter to split projects.))

Christian.
Previous: Michael J GruberNext: Eric Raible
Message 5 of 12 in “Excluding files from git-diff”
  1. Erik HahnOct 17, 2008
  2. Raphael ZimmererOct 17, 2008
  3. Johannes SchindelinOct 17, 2008
  4. Michael J GruberOct 17, 2008
  5. Christian JaegerOct 17, 2008
  6. Eric RaibleOct 17, 2008
  7. Christian JaegerOct 18, 2008
  8. Jeff KingOct 18, 2008
  9. Christian JaegerOct 18, 2008
  10. Jeff KingOct 18, 2008
  11. Jeff KingOct 18, 2008
  12. Anders MelchiorsenOct 17, 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.