Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Raquel Smith
Raquel Smith
10,683 Points

How do I use Git with WordPress?

I took the courses on Git and I understand how it works. However, I would like to use Git (and GitHub) to work on a WordPress project. However, I don't know what this would look like or how I would use git to push my changes to the live website.

I would also like to test any potential changes on a local server How can I do this with Git?

Thanks!

2 Answers

Michael Guay
Michael Guay
5,297 Points

To develop with WordPress locally you can use an application like MAMP to achieve this. See this link on how to set up a local MAMP server and develop with it:

https://premium.wpmudev.org/blog/develop-wordpress-locally-mamp/?wpcv=b&utm_expid=3606929-93.spVh-aR3SwGklKzL4HJQQg.1&utm_referrer=https%3A%2F%2Fwww.google.ca%2F

Once you have that set up, you will be developing your WordPress site within your htdocs folder. If you wanted to push/track your work with Git you could initialize a repo within that htdocs folder and push your changes whenever you wanted!

Hopefully this helped, if you are still confused do not hesitate to ask further questions.

Raquel Smith
Raquel Smith
10,683 Points

If you wanted to push/track your work with Git you could initialize a repo within that htdocs folder and push your changes whenever you wanted!

This is the thing I am struggling with. Do you have a suggestion for a tutorial on this? And would it be the same when pushing updates to a live site?