简体   繁体   English

Git签出不适用于WordPress的子模块

[英]Git checkout for submodules not working for WordPress

I have WordPress as a git submodule and it is checked out at tag 3.8.1. 我将WordPress作为git子模块,并在标签3.8.1处签出。

I want to get the latest version of WordPress which is 3.8.2. 我想获取WordPress的最新版本是3.8.2。

I have done the following structure: 我已经完成以下结构:

/html
    /wp - submodule to WordPress

I then run the following commands: 然后,我运行以下命令:

$ cd wp
$ git checkout 3.8.2
Previous HEAD position was 22bb602... Tag 3.8.1
HEAD is now at 5577e02... Tag 3.8.2

However when I go and check the WordPress dashboard it still tells me that I still need to update to 3.8.2. 但是,当我检查WordPress仪表板时,它仍然告诉我仍然需要更新到3.8.2。

3.8.2 is actually a tag, not a branch. 3.8.2实际上是标签,而不是分支。 It points to a specific commit. 它指向一个特定的提交。 Pulling makes no sense there. 拉在那里毫无意义。

If you want to stay up-to-date with the 3.8 version use the branch 3.8-branch . 如果要保持3.8版本的最新状态,请使用分支3.8-branch

$ git checkout 3.8-branch
$ git pull

This was a complete red herring. 这是完全的红鲱鱼。 The git checkout 3.8.2 was working. git checkout 3.8.2正在运行。 But I hadn't properly checked the file changes and there's no such indication that the files have been updated as when you do a git pull . 但是我没有正确检查文件更改,也没有像git pull那样显示文件已更新。

However the WordPress dashboard was thinking that I was not on the latest version because I am using a dutch translated version of WordPress. 但是WordPress仪表板认为我没有使用最新版本,因为我使用的是荷兰语翻译版本的WordPress。

So in the wp-config.php I have define( 'WPLANG', 'nl_NL' ); 因此,在wp-config.php中,我define( 'WPLANG', 'nl_NL' );

This then requires that you are using the nl-NL installation of WordPress from eg https://downloads.wordpress.org/release/nl_NL/wordpress-3.8.2.zip 然后,这要求您使用https://downloads.wordpress.org/release/nl_NL/wordpress-3.8.2.zip中的WordPress的nl-NL安装。

However because I am using the github version of WordPress, that only has the US English version of WordPress. 但是,因为我使用的是github版本的WordPress,所以只有美国英语版本的WordPress。 Its a hack, but to fix the problem I just edited the wp-includes/version.php file, to include the following line at the bottom, which is the only file that differs in the WordPress core for the translated version: 它是一个hack,但是为​​了解决这个问题,我刚刚编辑了wp-includes / version.php文件,在底部添加了以下行,这是翻译版本的WordPress核心中唯一不同的文件:

$wp_local_package = 'nl_NL';

Then WordPress is happy that you have the latest version. 然后WordPress很高兴您拥有最新版本。

Then you have to pull in the translation files. 然后,您必须提取翻译文件。

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

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