避免Git和WordPress在localhost和webhost上的冲突?

dy1byipe  于 2023-06-20  发布在  Git
关注(0)|答案(1)|浏览(130)

所以,基本上webhost和localhost有冲突。我还没把它们合并。我刚刚做了一个...

git status
git diff HEAD

这些是结果,一些未跟踪的RankMath文件在webhost和即将到来的冲突在WordPress上的WordFence插件日志...

webhost (PULL): git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   wp-content/wflogs/config-transient.php
    modified:   wp-content/wflogs/rules.php

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    wp-content/uploads/rank-math/rank_math_23e48e66683b46f3bb15aca54a7da030.xml

no changes added to commit (use "git add" and/or "git commit -a")

webhost (PULL): git diff HEAD
diff --git a/wp-content/wflogs/config-transient.php b/wp-content/wflogs/config-transient.php
index b34dac3f..5e284575 100644
--- a/wp-content/wflogs/config-transient.php
+++ b/wp-content/wflogs/config-transient.php
@@ -3,4 +3,4 @@
 This file is used by the Wordfence Web Application Firewall. Read 
 more at https://docs.wordfence.com/en/Web_Application_Firewall_FAQ

处理这种情况的最好办法是什么?我应该把/wp-content/wflogs/* 放在.gitignore中吗?

ffscu2ro

ffscu2ro1#

你不需要假设不变。只需将其添加到. gitignore即可。这也会阻止localhost提交它。作为一般规则,应始终忽略日志文件。它们是特定于它们所创建的环境的。

  • 尼尔波
    添加到.gitignore解决了这个问题

相关问题