git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Karl <kk_konrad@gmx.at>
To: git@vger.kernel.org
Subject: .gitignore: according to what rules does this work
Date: Wed, 26 May 2010 18:23:06 +0200	[thread overview]
Message-ID: <20100526162306.GA27815localhost> (raw)

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 <file>..." 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

             reply	other threads:[~2010-05-26 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 16:23 Konrad Karl [this message]
2010-05-27  8:51 ` .gitignore: according to what rules does this work - SOLVED Konrad Karl
2010-05-27  8:51 ` Konrad Karl
  -- strict thread matches above, loose matches on Subject: below --
2010-05-26 16:23 .gitignore: according to what rules does this work Konrad Karl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100526162306.GA27815localhost \
    --to=kk_konrad@gmx.at \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).