{"thread":{"id":"23916","subject":".gitignore: according to what rules does this work","startedAt":"2010-05-26T16:23:06Z","lastAt":"2010-05-26T16:23:06Z","messageCount":1,"participants":["Konrad Karl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"142379","messageId":"2033.90713218159$1274891002@news.gmane.org","threadId":"23916","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"}]}