git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* .gitignore: according to what rules does this work
@ 2010-05-26 16:23 Konrad Karl
  2010-05-27  8:51 ` .gitignore: according to what rules does this work - SOLVED Konrad Karl
  2010-05-27  8:51 ` Konrad Karl
  0 siblings, 2 replies; 4+ messages in thread
From: Konrad Karl @ 2010-05-26 16:23 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* .gitignore: according to what rules does this work
@ 2010-05-26 16:23 Konrad Karl
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Karl @ 2010-05-26 16:23 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .gitignore: according to what rules does this work - SOLVED
  2010-05-26 16:23 .gitignore: according to what rules does this work Konrad Karl
  2010-05-27  8:51 ` .gitignore: according to what rules does this work - SOLVED Konrad Karl
@ 2010-05-27  8:51 ` Konrad Karl
  1 sibling, 0 replies; 4+ messages in thread
From: Konrad Karl @ 2010-05-27  8:51 UTC (permalink / raw)
  To: git

This was actually a non-issue... see below
Konrad

On Wed, May 26, 2010 at 06:23:06PM +0200, Konrad Karl wrote:
> 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:
> 
> !**
> !**/
> 

There was a trailing blank after the first
asterisk. When trying  with two asterisks in despair
I started with a fresh file with no trailing blank.

Somewhat difficult to diagnose (now I am knowing better :)
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: .gitignore: according to what rules does this work - SOLVED
  2010-05-26 16:23 .gitignore: according to what rules does this work Konrad Karl
@ 2010-05-27  8:51 ` Konrad Karl
  2010-05-27  8:51 ` Konrad Karl
  1 sibling, 0 replies; 4+ messages in thread
From: Konrad Karl @ 2010-05-27  8:51 UTC (permalink / raw)
  To: git

This was actually a non-issue... see below
Konrad

On Wed, May 26, 2010 at 06:23:06PM +0200, Konrad Karl wrote:
> 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:
> 
> !**
> !**/
> 

There was a trailing blank after the first
asterisk. When trying  with two asterisks in despair
I started with a fresh file with no trailing blank.

Somewhat difficult to diagnose (now I am knowing better :)
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-27  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 16:23 .gitignore: according to what rules does this work Konrad Karl
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

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).