Wordpress项目的.gitignore文件中最合适的设置是什么?

时间:2012-11-28 14:06:03

标签: wordpress git

在使用带有Wordpress项目的git时,.gitignore文件的推荐设置是什么?

2 个答案:

答案 0 :(得分:12)

这是GitHub's help files

*.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

答案 1 :(得分:9)

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

我建议如下(基于Dales答案):

.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 /文件夹进行例外处理。