1

So I'm starting to get to grips with Git (never used any VCS before). Some Git users tell me to only push to production server and never pull from it to my local dev server. That leaves me with this scenario.

I run WordPress 3.0 in a Multi Site environment. On the production server, I create a new blog (let's call it no. 6) from the dashboard and need a custom theme for it.

I download the db from the live server and install it locally to have the latest plugin settings, blogs etc. I install the database, tweak all the urls to match localhost. But! the folder with the new blog will be missing from the wp-content folder because I'm not syncing that folder from liveserver to devserver.

Can i, with Git, checkout the most current repo from my live server to my local machine (or something like GitHub and then ) when I need to complete a task like this? Or am I looking at it the wrong way?

1

2 Answers 2

2

Can i, with Git, checkout the most current repo from my live server to my local machine?

No, unless you also add the wp-content folder under version control.

You can instead look at other tools, such as rsync.

As for the database, you could make the live server accept remote MySQL connections, so that you could work on it directly from your dev machine, although I don't think that's such a good idea.

0

Your question is both too vague and too specific at the same time. The answer to the first part of your question is "Yes, it's possible using Git, Subversion, Mercurial, DARCS, CVS, RCS, SCCS, SourceSafe, Perforce, or any number of other revision control systems". The answer to your second is "most likely, no, you're not looking at it incorrectly".

Can you be more specific in what you're asking and, simultaneously, what would make you think it's a bad idea?

2
  • I'm probably showing my lack of knowledge on this.
    – caneclap
    Commented Feb 15, 2011 at 10:53
  • I will try to make it a yes or no question. Is the following a good workflow? Site1 (active with many authors, comments and new photos everyday) has been live a few months, several edits, db changes, new plugins etc. It differs from the devserver. I download a copy of the db and replace the local db. Then I checkout (I think that's what you call it when you download a repo) the latest version from the liveserver. Now I can make changes in a environemnt that mirrors the liveserver. - This takes two weeks, and the I push changes to prod server, which has changed a lot since last checkout.
    – caneclap
    Commented Feb 15, 2011 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.