Git Workflow with WordPress - Localhost to Live

Viewed 5722

I have a basic but common WordPress workflow question.

Current Workflow

  1. I develop everything locally
  2. FTP files (and database dump) up to the server to show client
  3. Make requested changes locally
  4. FTP files (and database dump) up the server again
  5. More local edits
  6. FTP (and database dump) up again
  7. Rinse and repeat

This has become a monster pain. There has to be a better way

Suspected Git workflow

  1. Local copy will be my ‘master’
  2. ‘Push’ files up to somewhere
  3. ‘Pull’ files from this place in the middle to my live/testing server

I think I have an idea of how it should conceptually be done, but I don’t know how it should practically be done. Should I use a Github private repo in the middle? Is there a way for my Live site to “Pull” directly from my localhost repo?

Apologies if this seems elementary or beaten to death already, but I’ve searched and haven’t found a basic “This is how your workflow should look” guide.

With thanks!

Terry

3 Answers

I understand it's so annoying and tiresome that's why a lot of developers choose a professional way to do it. This will not only help them save their time but also improve their work productivity. Basically, there are two major scenarios in WordPress GitHub development workflow. The first one, using WordPress and Github in a live environment, and the other one when you are working in a local environment. Where local workflow is simple. All you need to do is just push and pull the changes from GitHub to local or vice versa.

(working in a live environment with multiple teams is quite complex)

In a live environment workflow, first, you have to push Live WordPress site files to the GitHub Repository then Pull them to the Local Folder.

After that, Build Development Environment on the local Machine (edit the code) and Push from Local to GitHub.

Now, for pulling the changes to the live environment first you need to connect GitHub with Live Environment.

You can read this detailed WordPress and GitHub guide and I hope this will help you out: https://www.cloudways.com/blog/wordpress-github/

Related