We are using SVN (on our own server) to manage source code and other related documents for our Wordpress Theme projects. Problem with SVN is that branches management (different versions of theme) is not straight-forward and quite slow. Merging branches is also complex. Releasing a branch is not possible (you have to export end upload to server by yourself)...

We are looking at Github. Does anyone have experiences using Github to manage your wordpress theme project? How do you prepare folder structure?

Totally use git. Github is a nice wrapper with some extra added bells and whistles. We use github for managing the marketplace codebase, and it works wonderfully. Once you go to git, you’ll wonder how you ever survived with SVN. I’ve used CVS, SVN, even ClearCase… shiver. git is much, much better than all of them. bitbucket uses mercurial, which I’ve only used a bit, but is pretty comparable with git too, and quite good from what I hear, just not as widely adopted.

cactusthemes said
My main concern is localhost development.
1. Do you work directly on Git folder or do you work on a local version, then copy into Git folder (then push to Github)?

Technically git lets you work “however you want”, but I’ll assume the bare origin repo/local checkout pattern that almost everyone uses in practice:

The “source of truth” for your team is the central git repo – github in this case. All code lives there, but you don’t work on it directly. You checkout (make an initial copy) of the code to your local dev machine, make changes to your local files, add them with git, commit them, then push them to the repo. You and other members of the team then pull each other’s changes.

cactusthemes said
2. If you work directly on Git folder, so you have to push a full copy of Wordpress to Github?

It depends on how you want to manage it. You would probably have the theme directory as it’s own git repo. That can then get checked out into a wordpress install locally that need not be in git. The checked out directory just looks like a regular directory with regular files in it (and a .git directory containing the git specific files it needs)

cactusthemes said
3. If you work on another copy for localhost, so what is the process? Copy from Git folder to localhost, then after changing, copy from localhost to Git? This is the same process we are using on SVN, and it sometimes causes code conflict or code lost

Again, it depends how you want to manage it. You could just have different branches that you checkout if you want to work on different versions of your plugin, and merge changes between them. Git makes this pretty easy.

If you’re wanting multiple copies of the project (in different wordpress versions etc), I guess you could symlink the same theme directory into place, or just have different checkouts if you wanted. You’d need to keep pushing/pulling changes though to keep them in sync. Not hard, just extra steps to manage. Git is generally pretty good at handling merge conflicts (better than SVN from memory).

You’ll still get that if you work on the same parts of the same file at the same time though. That’s unavoidable, whatever your approach

cactusthemes said
4. What happens if you want to work on older version of project? Copy to another localhost folder? (Says you are developing 3.9 version, but want to fix 3.8 version?)

Easy. Just create a branch for 3.8 and 3.9, and cherry-pick/merge changes into them from master (assuming to do main development there). Git handles this really well.

cactusthemes said
Any suggestions/shares would be appreciated. I think it will be useful for many teams

What I’d do is keep most of your development on master, then have a branch for each release you need to maintain. To release a new version, you branch from master again. Any fixes for older versions get cherry-picked from master, or made in the branch directly if they’re only applicable there.

You could also look at using feature branches and pull requests depending on how big your team is, and how much co-ordination and/or code-review you want to use.

What I’d do is keep most of your development on master, then have a branch for each release you need to maintain. To release a new version, you branch from master again. Any fixes for older versions get cherry-picked from master, or made in the branch directly if they’re only applicable there.

You could also look at using feature branches and pull requests depending on how big your team is, and how much co-ordination and/or code-review you want to use.

If you want to move away from SVN but are concered about the security of GitHub. Why don’t you run your Git on your own server. Check out the software called Gitorious http://getgitorious.com/. It is the same thing as GitHub however you can host it on your own server.

Post Reply

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody