我正在使用git在本地主机上运行wordpress工作流(基于Mark的Wordpress localhost )。我的文件结构如下所示
local.dev
我想要做的是从github获取最新的wordpress,并将其放入核心/以便升级过程看起来像
rm -rf wordpress
svn export http:// core.svn.wordpress.org/trunk/ wordpress
git add --all wordpress
git commit -m 'Upgrade WordPress' wordpress
git push origin master但是,我正在想办法把Wordpress放在自己的目录中,而不是
我遗漏了什么?
谢谢
发布于 2012-05-11 14:49:14
听起来您想要使用子树合并:http://git-scm.com/book/ch6-7.html
发布于 2012-05-15 13:00:20
解决方案
正如安德鲁建议的那样,答案是使用子树合并。
创建个人Wordpress Repo
我将它用作,远程wordpress回购- diff分支,用于diff wordpress版本。
#Create new repo as the wordpress parent
mkdir wprepo && cd wprepo
git init
touch README
git add .
git commit -m 'initial commit'
#Add the github mirror as a remote repo
git remote add wordpress git://github.com/markjaquith/WordPress.git
#Get the tags
git fetch -t wordpress
#Merge with the required tag
git merge --squash --no-commit -s recursive -X theirs tags/3.3.2
git commit -m '3.3.2'地方发展
回到我的本地机器上,我创建了一个local.dev/,并将我的远程开发回购(使用git -裸init在web服务器上创建)克隆到它中。然后,我使用子树合并添加wordpress回购。
#Create new repo as the wordpress parent
mkdir local.dev && cd local.dev
#Clone remote development repo
git clone ssh://gituser@remote_server_domain.com/home/gituser/gitrepo .
#Merge remote wordpress repo into core/
remote add -f core ssh://gituser@remote_server_domain.com/home/gituser/wprepo
git merge -s ours --no-commit core/master
git read-tree --prefix=core/ -u core/master
git commit -m 'merging wprepo into core/'
#Push changes to the remote dev repo
git push origin master也许有一个更简单的方法(如果你知道的话,请告诉我。)但它对我有效。从下面的来源拼凑而成的台阶。
资料来源
https://stackoverflow.com/questions/10522574
复制相似问题