Development Blog

Where we pretend to know how to code.


Why I love git (and this isn't a RP post so you probably won't be interested)

Published: 2012-12-16

Author: Teddi

Lately I’ve been powering on with development in various areas and making things as straight-forward as possible has been my #1 goal. Productivity up there, reduce the amount of tedious and push things out. With a nice batch of updates soon to come out among other things it means that even a minor slip-up can be costly and cause fatal issues. Now it’s no secret I really like git. I mentioned we swapped from it and (briefly why) that it’s so much better, but today I want to delve even further into why.

I’ve explained git’s branching system somewhat before, but for those that don’t quite understand, here’s an image explaining the brief difference between SVN and git.

However today, I came across a fundamental issue. I’d been working on a system for a while that greatly expands and modifies how admins are loaded and stored in the long run, so should the sql system ever die temporarily (eg a web-server outage), there’s a local backup system which means admins can still retain control of the system. Now I had worked on this for a solid few days before swapping back to other (at the time) more important things and today I came back to work on it, but hang on, there’s an important issue here.

The code in my development branch for this update, completely differs from the new code in my main branch! Obviously this doesn’t help me in the long run because who wants to slowly merge things across files. And using git’s merge system would be horrible because then it comes across as updates, when in reality it’s not.

However, git being the best thing since forever, has a command called rebase. What this clever thing does is it looks at the history of the branch I tell it to (in this case master), and it goes okay, all this was updated here and then, so we’re going to update this development branch up to what we have so far, and then re-apply all the changes we made in this branch! And it appears to work flawlessly.

In short, git makes programming fun and straightforward. If you ever plan on doing programming projects, I would seriously recommend this over all other revision systems out there.  Without it, SVN would be slapping me around right now :(

[Forum thread

](http://www.bbservers.co.uk/forums/showthread.php?8098-Why-I-love-git-(and-this-isn%92t-a-RP-post-so-you-probably-won%92t-be-interested))


Historical Posts