2

I have a .gitignore file which I am trying to only let git see the dirs and files in /wp-content/plugins/event-manager and /wp-content/themes/StringsV2.

The one for the theme is working but the plugin one only includes the dir and ignores all the files.

# Ignore everything in the root except the "wp-content" directory.
/*
!.gitignore
!wp-content/
!wp-config.php

# Ignore everything in the "wp-content" directory, except the "plugins"
# and "themes" directories.
wp-content/*
!wp-content/plugins/
!wp-content/themes/

# Ignore everything in the "plugins" directory, except the plugins you
# specify (see the commented-out examples for hints on how to do this.)
wp-content/plugins/*
!wp-content/plugins/event-manager/

# Ignore everything in the "themes" directory, except the themes you
# specify (see the commented-out example for a hint on how to do this.)
wp-content/themes/*
!wp-content/themes/StringsV2/

Any ideas where it is going wrong? Thanks

rnevius
  • 24,711
  • 10
  • 51
  • 76
rosscooper
  • 1,596
  • 2
  • 12
  • 26
  • 1
    Git won't include dirs unless they have files in them...Have you done `git add wp-content/plugins/event-manager/`? That should track the directory and expose its inner contents to git. – rnevius Aug 24 '15 at 14:18
  • Yes I have tried adding but still nothing it doesn't track the files – rosscooper Aug 24 '15 at 14:28
  • 1
    What makes you think that your files are not being included? Please edit your question, and give us the output of `git status`. – Joseph K. Strauss Aug 24 '15 at 15:22

1 Answers1

1

Try the git check-ignore to find out how git is ignoring a file/folder for example:

$ git check-ignore -v sql

found from this article: Git is ignoring files that aren't in gitignore

Community
  • 1
  • 1
Samuel
  • 1,677
  • 4
  • 16
  • 28