0

So my problem is that, i've created a .gitignore(to ignore one subfolder, but not the content of a specific folder)

My working tree is like:

A
|___
|   |
B   C

I want to ignore ALL the content inside C, but it should not ignore a specific folder inside C.

Here's my .gitignore

!www/
www/*
!www/wp-content/
www/wp-content/*
!www/wp-content/themes/
www/wp-content/themes/*
!www/wp-content/themes/ako-child

So to make it more understandable, it should ignore www completely, execpt ako-child.

The problem is, that it ignores EVERYTHING, also the content inside /ako-child.

And my git says:

Untracked files: (use "git add ..." to include in what will be committed) www/

I hope someone can help me out.. Kind regards

  • That actually looks like it's working. Use `git status -uall` to show the individual untracked files: they're probably files inside `www/wp-content/themes/ako-child/`, or the file `www/wp-content/themes/ako-child` (if it's a file). – torek Sep 24 '18 at 07:34
  • Holy cow, yes! I'm not sure what i should do next.. I'm trying to learn git.. Thank's @torek – johnnotdoe Sep 24 '18 at 07:35
  • Possible duplicate of https://stackoverflow.com/questions/5533050/gitignore-exclude-folder-but-include-specific-subfolder – Tony Sep 24 '18 at 07:37
  • @Tony how can it be a duplicate? My issue is that i couldn't understand why it wouldn't work.. – johnnotdoe Sep 24 '18 at 07:39

0 Answers0