How to use one git (github) repository for version control for multiple themes

I have built and maintain many themes for various clients. I'd like to be able to put them all in github for lovely version control. However github gets a bit expensive when you have over 20 private repositories. I'm going to have about 30+. The themes are not used together, each one is for a separate client.

I know I can host my own git install, but then I lose the great diff tools and social aspects of github. It's also nice to have all your code in one place.

So I'm wondering if there is another way to put all themes in one repo and separate them in some intelligent way.

I thought about using gitignore, but then for each clone, you need to reconstruct the correct .gitignore. not workable.

Maybe using branches is the right approach, but I'm unfamiliar with how that would work.

One other aspect, I've been using deployhq.com (a great service) to deploy the changed files via ftp to the servers. And it's working great. And for site still in development I create a git service hook and after each push, the project gets deployed automatically by deployhq - awesome.

Any advice about how to accomplish this via branches, or via any other method?

Topic github git version-control themes Wordpress

Category Web


As of 2019 GitHub now offers unlimited private repos and unlimited public repos in its free plan for individual users. See https://github.com/pricing. Apart from that Bitbucket and GitLab.com both offer unlimited private repos as well.

That said I wouldn't recommend putting multiple themes into one single repo. State of the art is to use Git Flow (see the famous git-flow cheatsheet) or some similar approach that lets you have one develop branch in which pull requests get merged and when time is ready a release is made which will get merged into a master branch together with a version tag.

Imagine that flow now with multiple themes. You'd need multiple develop and master branches, one for each theme. And you'd also need custom tags for every theme, since every tag must be unique, means you can't tag 1.0.0 in more than one branch. Though this still might be a way to go if you are OK with it. Just get familiar with Git branching, create a new branch git checkout -b foo and commit your "foo theme", then create another branch git checkout -b bar and commit your "bar theme". Maybe this resource might be a little helper then: https://github.com/Kunena/Kunena-Forum/wiki/Create-a-new-branch-with-git-and-manage-branches


You might also consider checking out CircleCI which offers 1000 free build minutes per month (actually it's 250 per week) per user for private repos. If it's just for theme deployment it will be really difficult to hit that limit quickly.


  1. You have to use branches (git can clone single branch from repo) in case if you'll stick with Github
  2. If you can think about using hosted Git outside Github, you can select Assembla with Git and, f.e, Starter Plan ($9), it which you'll get one (private) space and unlimited independent repos in space

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.