{"thread":{"id":"23920","subject":"Re: .gitignore: according to what rules does this work - SOLVED","startedAt":"2010-05-26T16:23:06Z","lastAt":"2010-05-27T08:51:47Z","messageCount":3,"participants":["Konrad Karl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"299178","messageId":"20100526162306.GA27815localhost","threadId":"23920","inReplyTo":null,"subject":".gitignore: according to what rules does this work","fromName":"Konrad Karl","fromEmail":"kk_konrad@gmx.at","sentAt":"2010-05-26T16:23:06Z","receivedAt":"2010-05-26T16:23:06Z","isPatch":false,"sender":{"key":"kk_konrad@gmx.at","avatar":null},"body":"I have the following directory layout and want to exclude\ndir2 .. dirN\n\nThe following arrangement of .gitignore seems to work ok\nbut I was unable to find docs about the double asterisks.\n\n./.gitignore:\n\n*\n*/\n!.gitignore\n!/dir1/\n\n\ndir1/.gitignore:\n\n!**\n!**/\n\nthese two lines seem to be enough to have all subdirectories\nwithin dir1 being included (which is desired) but why?\n\n|-- .gitignore\n|-- dir1\n|   |-- .gitignore\n|   |-- file1\n|   |-- subdir1\n|   |   |-- file1\n|   |   `-- subsubdir1\n|   |       |-- file1\n|   |       `-- subsubsubdir1\n|   |           `-- file1\n|   `-- subdir2\n|       `-- file1\n|-- dir2\n|   `-- file1\n.\n.\n.\n--- dirN\n    `--file1\n\ngit add . says:\n....\n# Changes to be committed:\n#   (use \"git rm --cached <file>...\" to unstage)\n#\n#       new file:   .gitignore\n#       new file:   dir1/.gitignore\n#       new file:   dir1/file1\n#       new file:   dir1/subdir1/file1\n#       new file:   dir1/subdir1/subsubdir1/file1\n#       new file:   dir1/subdir1/subsubdir1/subsubsubdir1/file1\n#       new file:   dir1/subdir2/file1\n\nBefore discovering this I was playing like this:\n\n!*\n!*/\n!*/*\n!*/*/ \n\nand so on.\n\nGreetings,\nKonrad\n"},{"id":"142409","messageId":"13021.5632067577$1274950323@news.gmane.org","threadId":"23920","inReplyTo":"20100526162306.GA27815localhost","subject":"Re: .gitignore: according to what rules does this work - SOLVED","fromName":"Konrad Karl","fromEmail":"kk_konrad@gmx.at","sentAt":"2010-05-27T08:51:47Z","receivedAt":"2010-05-27T08:51:47Z","isPatch":false,"sender":{"key":"kk_konrad@gmx.at","avatar":null},"body":"This was actually a non-issue... see below\nKonrad\n\nOn Wed, May 26, 2010 at 06:23:06PM +0200, Konrad Karl wrote:\n> I have the following directory layout and want to exclude\n> dir2 .. dirN\n> \n> The following arrangement of .gitignore seems to work ok\n> but I was unable to find docs about the double asterisks.\n> \n> ./.gitignore:\n> \n> *\n> */\n> !.gitignore\n> !/dir1/\n> \n> \n> dir1/.gitignore:\n> \n> !**\n> !**/\n> \n\nThere was a trailing blank after the first\nasterisk. When trying  with two asterisks in despair\nI started with a fresh file with no trailing blank.\n\nSomewhat difficult to diagnose (now I am knowing better :)\n \n"},{"id":"299179","messageId":"20100527085147.GB29598localhost","threadId":"23920","inReplyTo":"20100526162306.GA27815localhost","subject":"Re: .gitignore: according to what rules does this work - SOLVED","fromName":"Konrad Karl","fromEmail":"kk_konrad@gmx.at","sentAt":"2010-05-27T08:51:47Z","receivedAt":"2010-05-27T08:51:47Z","isPatch":false,"sender":{"key":"kk_konrad@gmx.at","avatar":null},"body":"This was actually a non-issue... see below\nKonrad\n\nOn Wed, May 26, 2010 at 06:23:06PM +0200, Konrad Karl wrote:\n> I have the following directory layout and want to exclude\n> dir2 .. dirN\n> \n> The following arrangement of .gitignore seems to work ok\n> but I was unable to find docs about the double asterisks.\n> \n> ./.gitignore:\n> \n> *\n> */\n> !.gitignore\n> !/dir1/\n> \n> \n> dir1/.gitignore:\n> \n> !**\n> !**/\n> \n\nThere was a trailing blank after the first\nasterisk. When trying  with two asterisks in despair\nI started with a fresh file with no trailing blank.\n\nSomewhat difficult to diagnose (now I am knowing better :)\n \n"}]}