简体   繁体   English

派生wordpress git存储库的最佳方法是什么?

[英]What is the best way to fork wordpress git repository?

I am staring new Wordpress project. 我正在盯着新的Wordpress项目。 I want to use WP Github repository as a base and push it to my own repository. 我想使用WP Github存储库作为基础,并将其推送到我自己的存储库中。 But also I want to save link to original WP repository, switch branches on it and pull new updates. 但我也想保存到原始WP存储库的链接,在其上切换分支并提取新更新。 What is the best strategy for this? 最好的策略是什么?

Just set up the official repository as official and your personal repository as personal or origin : 只需将官方存储库设置为official并将您的个人存储库设置为personalorigin

git remote add official <official_remote>

then 然后

git remote add personal <personal_remote_path>

or 要么

git remote rm origin ;# remove the current origin, presumably the official one
git remote add origin <personal_remote_path>

You can then use git fetch official and git merge to pull in updates from the official repository, or you can set the proper upstream tracking branches with git checkout . 然后,您可以使用git fetch officialgit merge从官方存储库中提取更新,或者可以使用git checkout设置适当的上游跟踪分支。 For example: 例如:

git fetch official
git merge official/master

or 要么

git checkout -b official-master --track official/master

Just get a fork of the WP repository on GH then clone your fork not the WP repository. 只需在GH上获得WP存储库的分支,然后克隆您的分支而不是WP存储库即可。 Then you can add official as a remote git remote add WP <the wp repo link> . 然后,您可以将Official添加为远程git remote add WP <the wp repo link> If you want your own work private however just clone the WP repository and create a new remote for your private repo git remote add private <repo link> . 如果您想将自己的工作设为私有,则只需克隆WP存储库并为您的私有仓库创建一个新的远程仓库git remote add private <repo link>

You should in my opinion branch of your work off master and keep master in sync with WP repo. 在我看来,您应该脱离母版工作,并使母版与WP repo保持同步。 So git checkout -b mybranch will create a new branch based on master. 因此git checkout -b mybranch将基于master创建一个新分支。 When you want to sync your master you should just git fetch and then git merge WP/master on your own master. 当您想同步您的母版时,您应该只进行git fetch ,然后在您自己的母版上git merge WP/master master。

You should rebase your branch on master when you update it with git rebase master mybranch 使用git rebase master mybranch更新分支时,应基于master重新分支

WP through out the whole commands is an alias for the official branch remote name if you cloned the WP repo it would be origin 整个命令中的WP是官方分支远程名称的别名,如果您克隆了WP repo,它将是原始的

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

相关问题 寻找一种部署我的wordpress网站(git存储库)的方法 - Looking for a way to deploy my wordpress sites (git-repository) 在Wordpress中检索特定帖子的最佳方法是什么? - What is the best way of retrieving a specific post in Wordpress? 远程确定Wordpress版本的最佳方法是什么? - What is the best way to determine a Wordpress version remotely? 禁用Wordpress上的javascript文件的最佳方法是什么? - What is the best way to disable a javascript files on Wordpress? 在Wordpress中与DynamoDB交互的最佳方式是什么? - What is the best way to interface with DynamoDB in Wordpress? 创建模块化Wordpress主题的最佳方法是什么? - What is the best way to create a modular Wordpress theme? 在wordpress woocommerce中更改货币的最佳方法是什么? - What is the best way to change currency in wordpress woocommerce? 将git repo部署到Wordpress SVN的正确方法是什么? - What's the correct way to deploy a git repo to Wordpress SVN? 将自定义搜索表单添加到wordpress导航菜单的最佳方法是什么? - What is the best way to add a custom search form to the wordpress navigation menu? 从节点应用程序发布到 Wordpress 博客的最佳方式是什么? - What is the best way to post to a Wordpress blog from a node app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM