【发布时间】:2015-08-24 14:12:13
【问题描述】:
我有一个 .gitignore 文件,我试图只让 git 查看 /wp-content/plugins/event-manager 和 /wp-content/themes/StringsV2 中的目录和文件。
主题的一个正在工作,但插件一个只包含目录并忽略所有文件。
# 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/
任何想法哪里出错了?谢谢
【问题讨论】:
-
Git 不会包含目录,除非它们中有文件...你完成了
git add wp-content/plugins/event-manager/吗?这应该跟踪目录并将其内部内容公开给 git。 -
是的,我已经尝试添加,但仍然没有,它不跟踪文件
-
是什么让您认为您的文件没有被包含在内?请编辑您的问题,并将
git status的输出提供给我们。