Question

Is it possible to manipulate Wordpress child theme on my remote DO server via Terminal? I want to include version control using Git.

Posted October 19, 2020 132 views
WordPressLAMP StackGit

I want to manipulate my Wordpress child theme (https://developer.wordpress.org/themes/advanced-topics/child-themes/), but I want to keep track of the versions. I recently learned about version control in Git and so my ideal situation would be if I could do this via my Mac Terminal on the DO server.

I know how to manipulate the child theme in the Wordpress wp-admin area itself, but is there anyway that I can do it directly on the DO server so that I can use the benefits of Git?

Is there another way that you recommend how I do this?

I have installed Ubuntu 20.04 with a LAMP stack.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hey @katovonkatz,

Yes, that is doable, I actually do the same thing at my end.

There are two possibilities, you could either add your whole WordPress site to git or just the child theme.

To do so you need to first SSH to the Droplet and then using the cd command go to the webroot of your website:

  • cd /var/www/yoursite.com

In there you could use the git init command to start a new project. That way your whole WordPress site would be tracked.

Or if you want specifically to track your theme, you could cd directly into the child’s theme directory:

  • cd /var/www/yoursite.com/wp-content/themes/your-child-theme

And run the git init in there.

Hope that this helps!
Regards,
Bobby

Submit an Answer