From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: ** X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=2.8 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INVALID_MSGID,MSGID_NOFQDN1,RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: (qmail 5926 invoked by uid 107); 26 May 2010 16:23:22 -0000 Received: from vger.kernel.org (HELO vger.kernel.org) (209.132.180.67) by peff.net (qpsmtpd/0.40) with ESMTP; Wed, 26 May 2010 12:23:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755540Ab0EZQXM (ORCPT ); Wed, 26 May 2010 12:23:12 -0400 Received: from mail.gmx.net ([213.165.64.20]:60008 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755054Ab0EZQXK (ORCPT ); Wed, 26 May 2010 12:23:10 -0400 Received: (qmail invoked by alias); 26 May 2010 16:23:08 -0000 Received: from dinoc9.indmath.uni-linz.ac.at (EHLO localhost) [140.78.117.79] by mail.gmx.net (mp011) with SMTP; 26 May 2010 18:23:08 +0200 X-Authenticated: #25381063 X-Provags-ID: V01U2FsdGVkX19bpUxju3Bb+Vuajl1ZrGT5WihOE5oLOhXRzkELQ3 i5ZWamkeZhjLGA Date: Wed, 26 May 2010 18:23:06 +0200 From: Konrad Karl To: git@vger.kernel.org Subject: .gitignore: according to what rules does this work Message-ID: <20100526162306.GA27815localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Y-GMX-Trusted: 0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org I have the following directory layout and want to exclude dir2 .. dirN The following arrangement of .gitignore seems to work ok but I was unable to find docs about the double asterisks. ./.gitignore: * */ !.gitignore !/dir1/ dir1/.gitignore: !** !**/ these two lines seem to be enough to have all subdirectories within dir1 being included (which is desired) but why? |-- .gitignore |-- dir1 | |-- .gitignore | |-- file1 | |-- subdir1 | | |-- file1 | | `-- subsubdir1 | | |-- file1 | | `-- subsubsubdir1 | | `-- file1 | `-- subdir2 | `-- file1 |-- dir2 | `-- file1 . . . --- dirN `--file1 git add . says: .... # Changes to be committed: # (use "git rm --cached ..." to unstage) # # new file: .gitignore # new file: dir1/.gitignore # new file: dir1/file1 # new file: dir1/subdir1/file1 # new file: dir1/subdir1/subsubdir1/file1 # new file: dir1/subdir1/subsubdir1/subsubsubdir1/file1 # new file: dir1/subdir2/file1 Before discovering this I was playing like this: !* !*/ !*/* !*/*/ and so on. Greetings, Konrad