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

how do I ignore a directory for diff

From
L.LongChair . <longchair@hotmail.com>
Date
Apr 5, 2015, 11:31 UTC
Message-ID
<BLU168-W455AD13F694F68E77DFD0EB4FF0@phx.gbl>
Hello,

I have been looking into ignoring a subdirectory of my tree for diffing with upstream. I'll explain the situation below :

My tree is a fork of an upstream repo. There is a specific directory in my tree lets call it foo/bar that i would like to ignore for diff. This directory includes only files that i added to my repo and is therefore irrelevant for diffing (i know all files in there have been added and are not in upstream). Having there in the diff is just making a lot of files to appear and that is confusing to see what is changed from upstream.

I have read the docs and found a way mentioning that i should add a line to .gitattributes with : foo/bar/* -diff

But this still lists the files in there when i'm diffing.
Is there any way to achieve this ? i cant find any clear explanation in the docs.
Any help would be greatly appreciated :)
Lionel.
 		 	   		  
Next: John Keeping
Message 1 of 4 in “how do I ignore a directory for diff”
  1. LongChair .Apr 5, 2015
  2. John KeepingApr 5, 2015
  3. Lionel CHAZALLONApr 5, 2015
  4. John KeepingApr 5, 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.