10

将 git 与 Wordpress 项目一起使用时,.gitignore 文件的推荐设置是什么?

4

2 回答 2

18

这是来自GitHub 的帮助文件

*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
于 2012-11-28T14:09:16.377 回答
10

将此作为答案发布,因为我似乎无法对答案发表评论。

我建议以下(基于戴尔斯的回答):

.htaccess
wp-config.php
wp-content/*
!wp-content/themes/
!wp-content/plugins/
sitemap.xml
*.log
sitemap.xml
sitemap.xml.gz

它的作用是首先忽略 wp-content 中的所有内容,然后对 wp-content/themes/ 和 wp-content/plugins/ 文件夹进行例外处理。

于 2012-11-28T15:23:36.453 回答