Morgan Green
Morgan Green

Reputation: 996

Gitignore ignoring file that I want included

I'm working on a CMS with the structure of

-root
---app
----themes
-----theme_name
-------template
-------js
-------parts
-------css

Within Themes I have a gitignore placed

*
!.gitignore
!SB_Blog_Home
!README.md

However I've noticed that within SB_Blog_Home I can add something to the root of the theme folder and it tracks it, but all the folders are ignored. Not sure what I've done wrong here, but any help would be appreciated.

Upvotes: 1

Views: 51

Answers (1)

VonC
VonC

Reputation: 1324606

* ignores files and folders alike.

Try instead to ignore files only, unignore folders and their content:

**
!.gitignore
!SB_Blog_Home/
!SB_Blog_Home/**
!README.md

Check what is and is not ignored with git check-ignore -v (the -v is important):

git check-ignore -v -- afile

Upvotes: 2

Related Questions