I’ve spent a few weeks on this one, and I’m finally giving in and asking for help. I think I’ve tried just about every method I’ve seen suggested in other posts and tutorials, however nothing seems to be working. Anyways, here is my setup-
I have a git repository stored on BitBucket that is my local repo. I want to push my changes to my remote production server (and also staging), but for now lets focus on making one work. The way I have the remote server set up is by using a post-receive hook outside of my public_html folder. The folder is called repos and the bare repo is called development.git. The post receive hook inside repos/development.git is simple enough-
#!/bin/sh
GIT_WORK_TREE=/home/peterj05/public_html git checkout -f
I added the production server as a remote inside my local repo as “production” and push to /myserversaddress/repos/development.git, and the post-receive hook then transfers it to my public_html folder where I want it. The problem is that I have WordPress added as a submodule and that the submodule does not get pushed along with everything else.
I’ve tried adding
git submodule init
git submodule update
to no avail.I’ve also tried some other methods, but either I’m screwing things up (which is entirely possible. While I’m not new to Git, I’m no expert by any means, and sometimes need things spelled out for me). Deployment options especially are new to me, which is why a lot of this has been so hard.
I’m willing to try just about any method, other than the pay service deployment options out there.
I’m at the end of my rope here. I’ve read so much and nothing seems to be working. I have to be missing something here. I am also pushing recursively in case anyone is wondering.
-P.J.