Home » Page 38

How Git made my day with cloning, branching and submodules

So today at work I started working on a website that’s basically a clone of another one. The website to clone has a rather old code base but a fully working control panel with order processing, payment reminders, CRM and more. As the code base for the website itself was way too old I decided that that part should be newly written. Nothing fancy, just loading a few things from a database and displaying it.

The control panel on the other hand has to stay updated for both websites. Feature wise they should stay similar and bugs found in one of the control panels should be fixed in the other. So why not generalize the control panel and make them identically the same? Well, thinking ahead, the target group of both websites is different so there are always going to be a couple of specific features not needed for the other target group.

Before I’ll tell what I did to make this possible I’ll explain the current setup of the first site (the original website being “cloned”).

The original Git repository contained a directory called admin. I cloned the repository to strip out everything besides the admin directory with git filter-branch. I then added this new repository as a submodule.

The new website is, of course, also a Git repository. Since I need the control panel for this website as well I could add a submodule that points to the original Git repository. But that would severely hinder the process of modifying it for the new website. So instead I cloned the control panel repository. In this clone I maintain a branch for the new website. The new website has a submodule that points to this branch.

The benefits that’s giving me this is that I can make all the modifications I want, commit them to the branch created for this. Any updates that should be applied to the other site as well can be cherry picked to the master branch. When done I let the main repository (the one I filtered out of the original website) pull the changes back.

All in all this might sound a bit complicated, but it isn’t really. Thanks to Git I can keep both control panels up to date and safe without too much worries. Thank you Git!

Game Coding Complete, 3rd edition

Game Coding Complete, 3rd editionLast Thursday I’ve made my first purchase over at Amazon and was happily surprised it arrived today. That’s the fastest delivery time I’ve experienced from a webshop not located in my country! So kudos to that.

Game Coding Complete, 3rd edition was what got delivered at my house. I’ve only skimmed through some pages and so far I like what I see. It’s quite a big book with 908 pages so I’m afraid it’s going to take me a while to finish it.

I ordered the book because although I’ve got quite a bit of programming experience, I don’t have much experience in programming games. Sure, I did a couple of small games and prototypes but never gotten much further than that. Since the author, Mike McShaffry, is quite the veteran I thought, why not learn from one of the best?

The book has lots of examples and am eager to start reading it.

Twitter update?

I’m checking if my freshly installed Twit-update plugin works. If all is well it should have added a new tweet to my account.

Now all you faithful followers will be updated when I post a new blog entry or edit one!

New website launched

So I’ve finally decided to do something useful with my website!

I’ve been planning to writing my own CMS to maintain my website from day one. Thing is, due to my day job taking up 40+ hours a week I don’t have much time to focus on this. Besides, my day job is web development so I really don’t have much energy nor motivation left to write a CMS. I figured others already did the hard part for me so instead, why not use what’s out there?

I’ve taken a look at MoveableType, which has a very nice admin panel, but installing it on a shared hosting provider is a bit of a pain so I ended up testing it in VMWare. Because of bad Perl support in shared webhosting land I wasn’t really looking forward to all the headaches updating would give me.

So what’s next? I had used WordPress a couple of years ago. Didn’t really like it, nor the interface nor the codebase. I was very surprised to see the new admin panel. Very easy to use just like MoveableType. The big pro for WordPress is it’s ease of installation, and the amount of themes and plugins.

At the moment I’m busy setting up all the pages. I plan on using this site to keep you updated on all my projects, be it games, applications or my BlitzMax user libraries. But I’ll also use the blog for my hobbies, which include guitar playing, Atari Jaguar, my dog and what not :-).

For now, this post is long enough me thinks!