Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
The main problem with WordPress is that a lot of configuration information is stored in the database. I suggest you re-phrase your question to include that. Maybe this answer about migrating between dev and production servers can be useful too? –  Jan Fabry Feb 17 '11 at 16:15

2 Answers 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.

share|improve this answer

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?

share|improve this answer
    
I'm probably showing my lack of knowledge on this. –  Kasper Sørensen Feb 15 '11 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. –  Kasper Sørensen Feb 15 '11 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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