openmind

Gerrit, Git and Github

Hi all !

On this article I’ll review GIT, Gerrit and GitHub. I wrote this because I wanted to make the best of my free time , to get to know some of the CM solutions out there. This analysis will just scratch the surface of each tool, so that in the future it can be used for a quick reference and compare.

GIT

What is it ?

GIT is a source code management tool(SCM) with a focus on speed. Coming in from the Linux world, it was initially designed and developed by Linus Torvals, but has since been adopted by many other projects.

How to use it ?

GIT represents a paradigm shift. It assumes that instead of being always committing to a centralized server, most of your commits will occur on your local machine and only at the end of your changes will you push your code to the main server. Also, unlike CVS and SVN, when using GIT you have all the code versions stored locally. Thus you can work offline and still have access to all previous version of code.

The picture below depicts the typical GIT code flow:

GIT_BLOG
 
David, Alice, Bob and Clair will typically fetch the everything from the origin repository. Then they can work on their on local repository and also create their local branches. They will also be able to share the branches between themselves. We’re they’re done with the changes all left to do is push the code to the origin repository.

Does it scale ?

GIT uses a lot of essentially O(n) data structures, and when n gets big, there’s were problems come to  surface. Anyway if you’re code base repository begins passing the physiological 1 GB barrier with lots of 20k files, you might start thinking if :

  • Do you really need a single huge repository or can you break it down in many ?
  • If you do need a huge repository, look into GIT protocol, as it allows for sparse checkouts and other options.

Support ?

GIT is free to use, even in the enterprise. There is huge community of users and user forums using GIT, so you won’t stand alone.  But if you wan’t to avoid most of the configuration hurdles and also use GIT in as integrated development framework  you should give Github or Collabnet a try.

Gerrit

What is it ?

Gerrit is a code review and collaboration tool Google created as part of the Android open source project. It provides a way for code to be submitted, reviewed, approved/rejected, and merged into a larger collaborative work. All without having to expose your integration build code base to direct access from the contributors.

How to use it ?

Gerrit provides authentication and authorization services for a git repository, allowing authorized users to either push their changes directly into the repository, or to push them into a code review queue, where other developers can review changes before submitting the change into the master repository.

The picture below shows the fundamental difference between using just GIT and using GIT+Gerrit.

GITandGerrit

Developers still get to fetch code from a central repository, but instead of pushing the changes back to the same, repository, code will be pushed to a pending changes location, and only after review will it be submitted to the main repository.

Does it scale ?

Yes it does. The scaling process is well documented within the official gerrit home page.You may face some hurdles, but you can always browse the forums and look for solutions.

Support ?

If you are looking for enterprise support, you might want to have a look at GerritForge which is a native GIT SCM adapter and in addition, it also interfaces with Jira, Teamforge, and IBM Rational Team Concert

Github

What is it ?

GIThub is a web-based hosting service for software development projects that use the GIT revision control system.

How to use it ?

My first advice would be for you to take some time to understand the principles of  the GIT revision control system itsel,  before embarking on GITHub. Once you understand GIT, you’re ready to test drive GITHub.  Simply head to https://github.com/signup/free and signup for a free account to see how things work.

Once you’ve completed your free registration , GITHub will display a very nice BootCamp area, as you can see below :

BootCamp

All you will have to do is to follow these 4 steps to have GITHub in sync with the GIT client in your computer. As you may have understood by now, GITHub is simply “GIT on the cloud”  in the sense that :

  • it allows you to create and manage several GIT code repositories providing a centralized view to them
  • access your uploaded code on the web
  • benefit from the social side of having everything on web.

On the social features , I would highlight the following : 

  • follow friends and see what are they working on
  • watch projects and be notified whenever the project has updates
  • warn a project author that you have some useful changes you would like to add by using pull request feature
  • check code issues for each of the repositories you are contributing too
  • create an organization type structure to establish teams with special permissions and keep track of the activities of several developers.

Does it scale ?

On January 2013, GitHub announced it had passed the 3 million users mark and was then hosting more than 5 million repositories. According to the terms of service,if an account’s bandwidth usage significantly exceeds the average of other GitHub customers, the account’s file hosting service may be immediately disabled or throttled until bandwidth consumption is reduced. In addition, while there is no hard limit, the guideline for the maximum size of a repository is one gigabyte.

Support ?

GITHub is free to use up to 4 repositories. From 5 repositories onwards , there are several pricing plans that can be upgraded or downgraded at any time. All payed plans have email support.

Final thoughts

As some readers pointed out, it is unfair to compare these three tools and choose a favorite one as they all serve different purposes.   Nevertheless I hope I have given you some insights about the three of them.

References

[1] GIT Local branching on the cheap ; About GIT ; http://git-scm.com/about

[2] Wikipedia; GIT software ; http://en.wikipedia.org/wiki/Git_(software)

[3]  GITHub enterprise; Bring Github to work;  https://enterprise.github.com/

[4] TeamForge for GIT;  Central control for DVCS. Enterprise-grade security and compliance ;http://www.collab.net/products/teamforge/git-for-the-enterprise

[5] Hacker news; Facebook hits GIT performance issue on large repository ; https://news.ycombinator.com/item?id=3548824

[6] General development and mailing list for GIT; GIT performance results on a large repository ;http://comments.gmane.org/gmane.comp.version-control.git/189776

[7] Vincent Driessen ; A successful GIT branching model ;  http://nvie.com/posts/a-successful-git-branching-model/

[8] Wikipedia ; Gerrit software ; http://en.wikipedia.org/wiki/Gerrit_(software)

[9] The University of Edinburgh- Informatics; Dice Labs : GIT and Gerrit ; http://www.not-a-service.inf.ed.ac.uk/services/git-and-gerrit

[10] Open stack Cloud Software ; Gerrit Code Review – Quick Introduction ;  https://review.openstack.org/Documentation/intro-quick.html

[11] GerritForge ; Git and Gerrit for the enterprise ; http://www.gerritforge.com

[12] Wikipedia; GitHub ; http://en.wikipedia.org/wiki/GitHub

  • Pankaj Gupta

    IMHO, It is wrong to compare these 3. A better way for you to make decision would have been to first write down your requirement and then look where it fit best. Selecting a tool based on it’s feature may lead to wrong decision.
    GitHub & Gerrit is based on Git but both have different “use cases” so IMO it’s like comparing kinnow, orange and sweet lime though all are similar fruits but tastes very different.

    • Fair comment. The purpose of this article is not to point out which one is best, as I also believe all the tools analyzed here serve a different purposes.

  • José Feiteirinha

    Great article!

    Quick note, on GitHub, if you go for a private repository, you always have to pay.

    I use assembla (https://www.assembla.com) for my private repositories.

    -Feiteira