• 15 December 2009Starting to git' it!

    Amazingly enough this website has never been under version control. Nevermind that I have in the past worked as a team of programmers, for two years using SVN (or was it CVS?) every single day from the command line editing hundred of C files under VIM... of all editors.

    This same person has been developing this site for about 3 years now (?) without version control. Personally I think it's rather funny.

    In layman's terms this is what would have been happening with any previous release were it be under version control:

    There would always have been a stable release. Available, always, anytime. If there is a bug to squash or a small feature to add, I'd have been able to just work on the stable release, and upload that promptly.

    Instead, nearly everytime soon after a release, including that last one, I started doing some refactoring and changing a lot of code which make it very difficult to upload changes to the server.. because a lot of code has become unstable.

    Well; the good news is I'm starting to "get" Git. I like it. Still have to find how to configure proper merge and diff tools on Windows. But I was able to push and pull repositories and merge changes, make new branches. The next release of the website will be under Git. That means from there on, I will keep always a "master" branch of the site AS IT WAS on the day of release. If I refactor anything, any feature, goes to a new branch. The "master" is untouched.

    I'm really happy to have looked into Git as well because it gave me ideas about sharing code and opening code for contribution and patches etc just seems much more feasible. With that said my first public project on Github will be the front-end code build tool which I mentioned in the last site news. It is almost ready.

    The next project on Github will be the whole front-end code for RevTK. A good part of the code is written as a small framework of sorts. For example the buttons, the progress bars, these sort of things are written as re-usable components. This package will take more time to put together, but starts to open more possiblities for contributions. For example anybody can contribute fixes to a javascript widget if it doesn't work in some obscure browser.. or on their iPhone, etc.

    These two projects will help me learn to be confident enough with Git to look at the next possibilities. But... one step at a time.

    If you are a developer and I have roused your interest in Git, here's a few links to save you a lot of pain, trust me! =)

    • Print out this illustration by Oliver Steele (from this blog post). The illustration is incredibly helpful to understand Git tutorials. Ignore the rest of the blog post for now, it is intermediate/advanced Git.
    • Run through this Visual Git Tutorial by Ralf Ebert. Sadly there is no part two yet. This is the most concise and to the point article I have seen so far. This article runs you through all the basic Git commands for a local repository.
    • You may want to print this Git cheat sheet.
    • A big draw of Git is of course the social site Github. At this point you may want to create your account on Github and follow their instructions.
    • From here on things get a little bit hairy unfortunately. You'll have to read a bunch of tutorials and blog posts, experiment.. read ProGit, learn.github.com, GitCasts, GitReady... this isn't very difficult, but takes time. The really hairy part is to learn to configure Git locally and setup some decent merge and diff tools, especially on Windows.
    To Git's credit... they have included some decent GUI tools. I don't use them much yet, but typing "gitk" once in a while is very handy as it displays a visual graph of the branches in the current project.

    There is a very nice Git GUI on Mac OS called GitX, and the good news is there is an Eclipse plugin in "incubation" phase at Eclipse.org, called JGit /EGit.

    If you're a developer I hope this can help you "git" it too! :)