.gitignore忽略了目录

时间:2015-08-24 14:12:14

标签: wordpress git gitignore

我有一个.gitignore文件,我试图让git在/ wp-content / plugins / event-manager和/ wp-content / themes / StringsV2中查看dirs和文件。

主题的一个是工作但插件只包含目录并忽略所有文件。

# 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/

任何出错的想法?感谢

1 个答案:

答案 0 :(得分:1)

尝试使用git check-ignore来了解git如何忽略文件/文件夹,例如:

$ git check-ignore -v sql

从这篇文章中找到:Git is ignoring files that aren't in gitignore