繁体   English   中英

.gitignore 与 wordpress 如何从 wordpress 中取消跟踪所有默认文件?

[英].gitignore with wordpress how to untrack all the default files from wordpress?

所以我有一个 wordpress 站点。 我正在使用xampp 直接在 wopress 站点文件夹的根目录中,我只放了一个.gitignore文件:

htttdocs/wordpresssite/.gitignore

像这样:

# Wordpress - ignore core, configuration, examples, uploads and logs.
# https://github.com/github/gitignore/blob/main/WordPress.gitignore

# Core
#
# Note: if you want to stage/commit WP core files
# you can delete this whole section/until Configuration.
/wp-admin/
/wp-content/index.php
/wp-content/languages
/wp-content/plugins/index.php
/wp-content/themes/index.php
/wp-includes/
/index.php
/license.txt
/readme.html
/wp-*.php
/xmlrpc.php

# Configuration
wp-config.php

# Example themes
/wp-content/themes/twenty*/

# Example plugin
/wp-content/plugins/hello.php

# Uploads
/wp-content/uploads/

# Log files
*.log

# htaccess
/.htaccess

# All plugins
#
# Note: If you wish to whitelist plugins,
# uncomment the next line
#/wp-content/plugins

# All themes
#
# Note: If you wish to whitelist themes,
# uncomment the next line
#/wp-content/themes

但是当我在可视代码中打开文件夹时,我仍然看到 10k 的变化。

我的问题是:

如何从 wordpress 中取消跟踪所有这些标准文件?

谢谢

“如何从 wordpress 中取消跟踪所有这些标准文件”

这是我用于我自己的 wordpress 网站/项目的:

以下指令进入位于您网站根文件夹中的.gitignore文件:

你的wordpress站点/.gitignore

一般指令

/*
!.gitignore  
!wp-content    
wp-content/*  

排除除名为“your-theme-folder”的主题之外的所有主题:

!wp-content/themes   
wp-content/themes/*    
!wp-content/themes/your-theme-folder   

排除除名为“your-plugin-folder”的插件之外的所有插件:

!wp-content/plugins   
wp-content/plugins/*   
!wp-content/plugins/your-plugin-folder  

因此, .gitignore文件的整个指令将如下所示:

/*
!.gitignore  
!wp-content    
wp-content/*  
!wp-content/themes 
wp-content/themes/* 
!wp-content/themes/your-theme-folder
!wp-content/plugins   
wp-content/plugins/*   
!wp-content/plugins/your-plugin-folder

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM