I'm working on a localhost to live wordpress workflow using git (based on Mark Jaquith's Wordpress Local Dev post). My file structure looks like this
What I want to do is to grab the latest wordpress from github and put it in core/ so that the upgrade process would look like
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
BUT I'm having a hell of a time figuring out how to put Wordpress in its own directory without
What am I missing?
Thanks
As Andrew suggested the answer was to use subtree merge.
I use this as the remote wordpress repo - diff branches for diff wordpress versions
#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'
Back on my local machine, I created a local.dev/ and cloned my remote development repo (created on web server using git --bare init) into it. Then I used subtree merge to add the wordpress repo.
#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
There maybe a much easier way to do this (If you know it please tell me.) but it worked for me. Steps cobbled together from the sources below.
http://jon.smajda.com/2011/07/17/wordpress-and-git/
http://joemaller.com/990/a-web-focused-git-workflow/
http://jasonkarns.com/blog/merge-two-git-repositories-into-one/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With