gpt4 book ai didi

WordPress作为git子模块,不小心通过WP admin更新而不是git,现在修改了内容

转载 作者:太空狗 更新时间:2023-10-29 14:19:24 25 4
gpt4 key购买 nike

我遵循 David Winter 的工作流程“使用 Git 安装和管理 WordPress”。 WordPress 是一个 git 子模块。在最新的 WordPress 3.9 升级中,我不小心通过 WordPress 管理员而不是通过 git 进行了更新。现在,当我运行 git status 时,我得到:

modified:   wordpress (modified content, untracked content)

这是有道理的。但是我不能提交修改后的wordpress内容。 WordPress 子模块脏了。如果我在我的主仓库中运行 git diff,我会得到这个:

-Subproject commit 22bb60277036651db73dc872eaa7d2a50276b00d
+Subproject commit 22bb60277036651db73dc872eaa7d2a50276b00d-dirty

解决此问题的最佳方法是什么?如果我在我的主仓库中运行以下命令,它会搞乱我的 WordPress 安装吗? (注意:我还更新了一些插件。)

git clean -dfx             # delete everything in the worktree that isn't tracked
git reset --hard # wipe all modifications to tracked files
git checkout 3.8.1 # return to previous version tag

更新:上面的命令运行良好。我检查了 git clean 上的文档以了解选项“d”、“f”和“x”是什么:https://www.kernel.org/pub/software/scm/git/docs/git-clean.html .在 WordPress 目录中运行之前的命令后,我能够 check out 版本 3.9,从而正确更新 WordPress。

最佳答案

以下命令运行良好:

git clean -dfx             # delete everything in the worktree that isn't tracked
git reset --hard # wipe all modifications to tracked files
git checkout 3.8.1 # return to previous version tag

我查看了 git clean 上的文档以了解选项“d”、“f”和“x”是什么:https://www.kernel.org/pub/software/scm/git/docs/git-clean.html .在 WordPress 目录中运行之前的命令后,我能够 check out 版本 3.9,从而正确更新 WordPress。

关于WordPress作为git子模块,不小心通过WP admin更新而不是git,现在修改了内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23207542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com