0

Hi guys wonder if there is something like a guide to use git to manage WP projects. I have always been a cowboy coder, and I need to make this shift to Git to become more standarized...how can I begin? at least i would love to have my theme in GIT to have a backup copy of it and be able to track the changes. Im the only person working on the project, but I need to prepare myself for future jobs so I want to test this GIT+WP.

  • 1
    Actually..., What stopped you? – Mayeenul Islam Apr 15 '15 at 11:45
  • what? sorry i dont understand what you refer to... – dmtnexer Apr 16 '15 at 12:38
  • I meant what have you tried? What the problem you faced using git with WordPress? – Mayeenul Islam Apr 16 '15 at 14:21
  • i have never used git, i use wp to make sites, i want to lear to use git with wp...but is the first thing i will use git for. any recommmendations? – dmtnexer Apr 21 '15 at 12:51
0

You questioned:

How to use wordpress with Git?

Actually your question is a bit wrong, and should actually be:

How to use Git with WordPress?

As git is for controlling versions so using it depends upon you what actually you want to take under version controlling. I personally develop WordPress themes and plugins so I control versions, specific to themes and plugins only.

For Themes

When developing a theme (i.e. my-theme is the folder name), I get into it:

cd my-theme
git init
git add -A
git commit -m "Started developing the theme"

In this way I manage all the versions of my development phase to that particular theme. But in the meantime WordPress can be updated, several plugins can be updated, and the /uploads/ folder can be updated too - I don't care actually. I just think about code and that's all.

In some cases I want the database to be version controlled too. In that case I export all the database tables into a .zip file and put it inside the theme into a _db_ folder and then add and commit.

For Plugins

Within my Plugin (i.e. my-plugin is the folder name), I follow the similar steps to control versions of my plugin.

For whole WordPress Project

To control versions of the whole WordPress project, get into the project folder and initiate git there to catch all the changes to the project.

project\
   .git\
   wp-admin\
   wp-content\
   wp-includes\
   ...

That's all what came to my mind.

0

hello fellow cowboy coder, I have been dabbling away with wp and git for some time. I have some projects stored on GIT, but they are there purely in a collaborative format. WP have there own repository for wp themes. Git is fairly straight forward to set up, there is a GUI for GIT, but its much more efficient to use the command line approches. GIT only gets messy when you are working with large teams updating into a project, since your the only Developer, you would be mainly doing git push's and only need to pull when your deploying the files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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