Git Ignore sub directory for WordPress theme

I am trying to setup GitIgnore to work with Git Tower (www.git-tower.com) and WordPress.

I want to have the repository in the root directory with the option to include just specific themes and plugins.

Read More

I will start with including just one theme sub directory.

Tower is not showing me the single theme directory. Instead it shows all of the wp-content folder. I expect this to be ignored as I have specified this in the ignore file.

So.. root: /

Directory to include: /wp-content/themes/raison-winetrust/

I tried the following:

        /*
        !.gitignore
        !/wp-content/
        /wp-content/*
        !/wp-content/themes
        /wp-content/themes/*
        !/wp-content/themes/raison-winetrust/

Screenshot: https://www.dropbox.com/s/9lajg1h89n2jwkr/Screenshot%202015-01-23%2013.53.48.png?dl=0

Any advice appreciated.

Thanks

Related posts

Leave a Reply

1 comment

  1. If you are only tracking that theme (not any of the other wordpress gubbins) why not initialise the git repo in the theme folder?

    The other option is that you just do a git add of that folder and only add that folder when there are changes.