{"thread":{"id":"39007","subject":"how do I ignore a directory for diff","startedAt":"2015-04-05T11:31:54Z","lastAt":"2015-04-05T14:58:25Z","messageCount":4,"participants":["LongChair .","John Keeping","Lionel CHAZALLON"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259018","messageId":"BLU168-W455AD13F694F68E77DFD0EB4FF0@phx.gbl","threadId":"39007","inReplyTo":null,"subject":"how do I ignore a directory for diff","fromName":"LongChair .","fromEmail":"longchair@hotmail.com","sentAt":"2015-04-05T11:31:54Z","receivedAt":"2015-04-05T11:31:54Z","isPatch":false,"sender":{"key":"longchair@hotmail.com","avatar":null},"body":"Hello,\n\nI have been looking into ignoring a subdirectory of my tree for diffing with upstream.\nI'll explain the situation below :\n\nMy tree is a fork of an upstream repo.\nThere 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.\n\nI have read the docs and found a way mentioning that i should add a line to .gitattributes with :\nfoo/bar/* -diff\n\nBut this still lists the files in there when i'm diffing.\n\nIs there any way to achieve this ? i cant find any clear explanation in the docs.\n\nAny help would be greatly appreciated :)\n\nLionel.\n\n \t\t \t   \t\t  "},{"id":"259019","messageId":"20150405121705.GE21452@serenity.lan","threadId":"39007","inReplyTo":"BLU168-W455AD13F694F68E77DFD0EB4FF0@phx.gbl","subject":"Re: how do I ignore a directory for diff","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-04-05T12:17:05Z","receivedAt":"2015-04-05T12:17:05Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sun, Apr 05, 2015 at 11:31:54AM +0000, LongChair . wrote:\n> I have been looking into ignoring a subdirectory of my tree for\n> diffing with upstream.  I'll explain the situation below :\n> \n> My tree is a fork of an upstream repo.  There is a specific directory\n> in my tree lets call it foo/bar that i would like to ignore for diff.\n> This directory includes only files that i added to my repo and is\n> therefore irrelevant for diffing (i know all files in there have been\n> added and are not in upstream). Having there in the diff is just\n> making a lot of files to appear and that is confusing to see what is\n> changed from upstream.\n> \n> I have read the docs and found a way mentioning that i should add a\n> line to .gitattributes with : foo/bar/* -diff\n> \n> But this still lists the files in there when i'm diffing.\n> \n> Is there any way to achieve this ? i cant find any clear explanation\n> in the docs.\n\nSince git-diff takes a pathspec you can use the exclude magic to exclude\ncertain directories like this:\n\n\tgit diff upstream -- ':(top)' ':(exclude)foo/bar'\n\nor equivalently:\n\n\tgit diff upstream -- :/ ':!foo/bar'\n\nThe documentation for the pathspec syntax is in git-glossary(7).\n"},{"id":"259022","messageId":"BLU436-SMTP49446C5C4D772905567D4B4FF0@phx.gbl","threadId":"39007","inReplyTo":"20150405121705.GE21452@serenity.lan","subject":"Re: how do I ignore a directory for diff","fromName":"Lionel CHAZALLON","fromEmail":"longchair@hotmail.com","sentAt":"2015-04-05T14:19:50Z","receivedAt":"2015-04-05T14:19:50Z","isPatch":false,"sender":{"key":"longchair@hotmail.com","avatar":null},"body":"Hello John,\n\nThanks for the answer. I am also using some GUI client (smartgit). Is there any way to make this part of the repo attributes / configuration so that my git GUI would use it ? \n\nLionel.\n\n> Le 5 avr. 2015 à 14:17, John Keeping <john@keeping.me.uk> a écrit :\n> \n> On Sun, Apr 05, 2015 at 11:31:54AM +0000, LongChair . wrote:\n>> I have been looking into ignoring a subdirectory of my tree for\n>> diffing with upstream.  I'll explain the situation below :\n>> \n>> My tree is a fork of an upstream repo.  There is a specific directory\n>> in my tree lets call it foo/bar that i would like to ignore for diff.\n>> This directory includes only files that i added to my repo and is\n>> therefore irrelevant for diffing (i know all files in there have been\n>> added and are not in upstream). Having there in the diff is just\n>> making a lot of files to appear and that is confusing to see what is\n>> changed from upstream.\n>> \n>> I have read the docs and found a way mentioning that i should add a\n>> line to .gitattributes with : foo/bar/* -diff\n>> \n>> But this still lists the files in there when i'm diffing.\n>> \n>> Is there any way to achieve this ? i cant find any clear explanation\n>> in the docs.\n> \n> Since git-diff takes a pathspec you can use the exclude magic to exclude\n> certain directories like this:\n> \n> \tgit diff upstream -- ':(top)' ':(exclude)foo/bar'\n> \n> or equivalently:\n> \n> \tgit diff upstream -- :/ ':!foo/bar'\n> \n> The documentation for the pathspec syntax is in git-glossary(7).\n"},{"id":"259024","messageId":"20150405145825.GF21452@serenity.lan","threadId":"39007","inReplyTo":"BLU436-SMTP49446C5C4D772905567D4B4FF0@phx.gbl","subject":"Re: how do I ignore a directory for diff","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-04-05T14:58:25Z","receivedAt":"2015-04-05T14:58:25Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sun, Apr 05, 2015 at 04:19:50PM +0200, Lionel CHAZALLON wrote:\n> > Le 5 avr. 2015 à 14:17, John Keeping <john@keeping.me.uk> a écrit :\n> > \n> > On Sun, Apr 05, 2015 at 11:31:54AM +0000, LongChair . wrote:\n> >> I have been looking into ignoring a subdirectory of my tree for\n> >> diffing with upstream.  I'll explain the situation below :\n> >> \n> >> My tree is a fork of an upstream repo.  There is a specific directory\n> >> in my tree lets call it foo/bar that i would like to ignore for diff.\n> >> This directory includes only files that i added to my repo and is\n> >> therefore irrelevant for diffing (i know all files in there have been\n> >> added and are not in upstream). Having there in the diff is just\n> >> making a lot of files to appear and that is confusing to see what is\n> >> changed from upstream.\n> >> \n> >> I have read the docs and found a way mentioning that i should add a\n> >> line to .gitattributes with : foo/bar/* -diff\n> >> \n> >> But this still lists the files in there when i'm diffing.\n> >> \n> >> Is there any way to achieve this ? i cant find any clear explanation\n> >> in the docs.\n> > \n> > Since git-diff takes a pathspec you can use the exclude magic to exclude\n> > certain directories like this:\n> > \n> > \tgit diff upstream -- ':(top)' ':(exclude)foo/bar'\n> > \n> > or equivalently:\n> > \n> > \tgit diff upstream -- :/ ':!foo/bar'\n> > \n> > The documentation for the pathspec syntax is in git-glossary(7).\n> \n> Thanks for the answer. I am also using some GUI client (smartgit). Is\n> there any way to make this part of the repo attributes / configuration\n> so that my git GUI would use it ? \n\nI think you'll have to file a feature request with SmartGit if you want\nsupport for this in their UI.\n\nThe standard way to set this up would be to create an alias that does\nwhat you want, such as:\n\n\tgit config alias.d 'diff -- :/ \":!foo/bar\"'\n\nand use \"git d\" instead of \"git diff\", but there is no way for other\nprograms to inherit that.\n"}]}