When using git with Wordpress project, what will be recommended settings for .gitignore file?
Dal*_*ale 13
这是来自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
Run Code Online (Sandbox Code Playgroud)
小智 9
将此作为答案发布,因为我似乎无法对答案发表评论.
我建议如下(基于Dales答案):
.htaccess
wp-config.php
wp-content/*
!wp-content/themes/
!wp-content/plugins/
sitemap.xml
*.log
sitemap.xml
sitemap.xml.gz
Run Code Online (Sandbox Code Playgroud)
它的作用是首先忽略wp-content中的所有内容,然后对wp-content/themes /和wp-content/plugins /文件夹进行例外处理.