Not sure if this is best place for this, but here goes.
So at the moment I have a live website which is running on WordPress and uses a theme from ThemeForest. I want to make some changes to the website, and develop this accordingly, I would like to develop both on my laptop at home and on my desktop at the office.
However, I’d like to the developments away from the live website and then push the updates from the development site to the live site via Git, if possible.
What would I need to achieve this? Do I need to setup a seperate hosting account for this?
After your done on Machine A, push the changes to your repo, then pull from the repo on machine B to update those files. Another option is to store the Project on a NAS and just access that from any machine/device.
Whatever you do though, make sure that development gets as close to production as possible. Running Apache in production? Run that in development as well. Running Nginx in production instead? Then run Nginx in development as well.
Running PHP 7.2 in production? Then run PHP 7.2 in development as well. A lower version would be ok-ish (even though you won’t be able to enjoy new features), but running a higher version than in production is a recipe for disaster, as some constructs will work in development but fail once they go to production.
I personally prefer virtual machines for development (also on a linux desktop) because it’s easy to destroy and create a new one when you mess something up too much (this ties nicely with pets vs cattle).
Docker may work as well, but has a steeper learning curve and doesn’t make much sense if production is not running on Docker too.