3

私は、gitを使用してローカルホストからライブワードプレスワークフローに取り組んでいます(MarkJaquithのWordpressLocal Dev投稿に基づいています)。私のファイル構造は次のようになります

local.dev

  • 。ギット
  • index.php
  • .htaccess
  • wp-config.php
  • local-config.php(無視されます)
  • コンテンツ/テーマ/
  • コンテンツ/プラグイン/
  • コンテンツ/アップロード/(無視)
  • コア/(ワードプレスコア)

私がやりたいのは、githubから最新のワードプレスを取得してcore /に入れ、アップグレードプロセスが次のようになるようにすることです。

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を自分のディレクトリに置く方法を考え出すのは大変な時間です。

  • svnを使用する
  • git pullをlocal.devに使用し、ファイルをcore/に手動で移動します。

私は何が欠けていますか?

ありがとう

4

2 に答える 2

3

解決

Andrewが提案したように、答えはサブツリーマージを使用することでした。

パーソナルWordpressリポジトリの作成

私はこれをリモートワードプレスリポジトリとして使用します-diffワードプレスバージョンのdiffブランチ

#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 --bare initを使用してWebサーバー上に作成)のクローンを作成しました。次に、サブツリーマージを使用して、ワードプレスリポジトリを追加しました。

#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

これを行うにはもっと簡単な方法があるかもしれませんが(知っている場合は教えてください)、それは私にとってはうまくいきました。以下の情報源から、ステップが一緒に石畳になりました。


ソース

  1. http://jon.smajda.com/2011/07/17/wordpress-and-git/

  2. http://joemaller.com/990/a-web-focused-git-workflow/

  3. http://jasonkarns.com/blog/merge-two-git-repositories-into-one/

于 2012-05-15T13:00:20.907 に答える
0

サブツリーマージを使用したいようです:http://git-scm.com/book/ch6-7.html

于 2012-05-11T14:49:14.930 に答える