Posts tagged: git

Despite Git’s reputation for being ridiculously command-line centric, Git users are actually pretty spoilt for choice when it comes to graphical front ends. Here’s what I use.

Atlassian SourceTree has been around for a while on the Mac, but it has only recently seen a 1.0 release for Windows. It is free, though it does require user registration.

In terms of features, SourceTree does just about everything I want it to, and visually it’s the one I find easiest on the eye. One particularly nice feature of SourceTree is that it automatically fetches from all your remotes every ten minutes, so you’re quickly kept abreast of what your colleagues are working on. My main gripe with it is that “Push” to a Subversion repository doesn’t work, even though it does bring up a dialog box saying that it will, so I have to drop to a command prompt to type git svn dcommit. I’d also like to see an interface to git bisect, though no doubt that will come in due course.

For integration with Windows Explorer and Visual Studio, I use Git Extensions:

I don’t use it for that much else, mainly because I find it visually a bit harsh, but it’s pretty fully featured. One nice feature is the ability to recover lost commits — useful if you do an unintended git reset --hard.

This time last year, the Eclipse Community Survey noted that Git’s market share had risen from 12.8% to 27.6%, while Subversion had dropped from a seemingly unassailable 51.3% to 46.0%. This year’s survey results, published yesterday, note that this trend has continued: Git/GitHub has risen to 36.3% while Subversion has dropped to 37.8%. Subversion may still be in the top slot for now, but its lead is tiny and it is rapidly losing ground.

Other data sources, such as itjobswatch.co.uk, paint a similar picture. Look at how demand for Git skills has grown in recent years:

Job trackers such as this tend to give Subversion a bigger lead, because they focus on the rather more conservative corporate market and purposely ignore the world of hobbyists and open source developers. But even so, the trend is clear. Thirteen percent of UK programming jobs now ask for Git experience. Seventeen percent ask for Subversion, but the gap is narrowing rapidly and it is almost certain now that Git will overtake Subversion in corporate settings by the end of this year.

We are now fast approaching the point at which not using Git will increasingly hurt developers and companies alike. As a developer, a lack of Git experience is now starting to call into question your willingness and ability to keep your skills up to date. As a company, if you don’t use Git, you will find yourself competing for good developers against companies who do. Once you’ve got used to Git, Subversion is a painful experience, and fewer and fewer competent developers will be prepared to put up with it given the choice.

Then there are third party products and services. Already we are seeing an increasing number of these coming on the market which only support Git — GitHub and Heroku being two prominent examples. Those that do support other alternatives are increasingly treating them as an afterthought, with only limited features. Even if you’re a Microsoft-only shop, Git is getting harder to avoid. Entity Framework and ASP.NET MVC, along with several other Microsoft-run projects, are now hosted using Git. Team Foundation Server is introducing Git as a first-class source control option, complete with the tight end to end integration experience which TFS users value so much. Windows Azure makes Git one of its main avenues for deployment.

Not only has Subversion fallen behind, its development is painfully slow. Subversion 1.7, originally scheduled for the spring of 2010, was only released in October 2011 — a year and a half late. Subversion 1.8 is also a year late and has had its scope cut back by a half. Subversion 1.9, tentatively slated for this time next year, could well see even more significant delays, especially if the shift in demand forces its key players to divert resources to Git-based products and services. Subversion 1.10, the first to promise some genuinely useful new features (shelving and checkpointing), is “speculatively at best” scheduled for mid-2015. It is quite possible that it may never be released.

Subversion has no future. It is old, obsolete, decrepit technology and you need to be planning for its end of life. Git, on the other hand, is rapidly becoming the lingua franca of source control throughout the entire software industry. Love it or hate it, but if you don’t take it seriously, it won’t be long before the industry doesn’t take you seriously.

I’ve had quite a few comments on my blog post about Git questioning my conclusions, so I thought I’d better follow them up, since my original post didn’t make it entirely clear why I’d come to the conclusions that I had.

Why did I write this post?

Up to now there’s been a possibility (and quite a plausible one at that) that Git’s popularity might be an illusion, thanks to the echo chamber of the blogosphere and its noisy fanboy culture, and that its usage might be largely restricted to open source projects, Ruby on Rails shops, and hobbyists, with little traction in corporate settings. This is what the Subversion folks would like us to believe:

Greg Stein, an Apache vice chairman and vice president of the Subversion project, suggests that Git’s rise may not be a deep one. “I think a lot of what we’re seeing is that Git has got a lot of mind share. [But] I don’t know if it’s necessarily true that a lot of corporate development shops are switching [to Git],” he says.

In the past year or so, there’s been some anecdotal evidence coming to light against this position, but no conclusive quantitative surveys up to now showing the extent of Git’s adoption in the enterprise. But the past three years have given us enough data to start coming up with some testable predictions as to what this year’s results would be, to confirm whether or not this might be the case.

In the end, Git’s result was significantly higher than even my most optimistic prediction, which leaves little or no room for argument on this one. Any claims that it hasn’t yet “crossed the chasm” are now quite frankly preposterous. The myth that it is not suitable for enterprise settings has been well and truly busted.

Isn’t this just fanboyism?

I’d just like to clarify in response to this one that I’m not a Git fanboy. I still have a strong preference for Mercurial, and have no intention of stopping using it in the immediate future. It is much more polished, much easier to learn, much more predictable, and all in all a much better advert for what distributed version control should be. It’s also much more powerful than Git users give it credit for, and much less intimidatingly elitist. In any case, I can always use hg-git to integrate it with Git repositories if necessary.

Personally, I feel that the software development world has been bullied into accepting Git instead by people who have insisted on treating the whole DVCS scene as if it were The Hunger Games, and if they’d only just recognised that the first and most important rule of marketing is that first impressions count the most, we’d have got to where we are now a whole lot faster.

In actual fact, many people who use Git are unhappy with it. It’s rather telling that Git not only has more “hates” on amplicate.com than TFS, but a higher ratio of “hates” to “loves.” Maxx Daymon says this:

Of the shops I know that have converted to git, it was driven by an aggressive few, and the majority of developers are and remain unhappy about it. They may get over it, but they certainly haven’t become git evangelists in the process.

Yes, Git has won, but it’s won a battle that it had no business fighting in the first place. Whether we like it or not, it’s well on its way to becoming the industry standard, so we just need to get used to it, like every other industry standard. (Heck, who in their right mind still thinks that XML was a good idea?)

Do the survey’s demographics affect my conclusions?

Two or three people asked me about potential sources of bias in the survey. While there will be demographic factors at work, as far as I can tell, these tend to reinforce my conclusions rather than undermine them.

The survey’s demographics are Eclipse users. Eclipse is a Java IDE, a whole lot of related tools, and the organisation (the Eclipse Foundation) that oversees their development. Java is, by some accounts, the most widely used programming language in the world, but it is not a trendy or cool language to work with like Python or Ruby (Android development notwithstanding), and Eclipse is not a trendy or cool IDE to use, so the chances are high that if you’re using it, you’re getting paid for it. In fact, the survey actually asked this question: only 3.8% of respondents were individuals, not associated with any organisation, and 6.7% were students.

The biggest area that is under-represented here is, obviously, Microsoft developers. This means mainly that we have little or no idea as to TFS’s market share. It also means that Mercurial usage may be under-represented too, but anecdotal evidence seems to suggest that there is a general drift away from Mercurial towards Git in the Microsoft world as well.

I wondered if Android development could be skewing the results, since Git is the de jure standard SCM for Android development, and Eclipse is the IDE recommended by Google. However, only 4.1% of respondents said that they are primarily developing mobile applications, so I don’t think that’s much of a factor after all.

All in all, it seems clear to me that we have a pretty enterprisey demographic here, certainly not one composed of early adopters and innovators. In fact, if anything, early adopters and innovators are probably under-represented. Besides, if this survey really had been influenced by early adopters and innovators, they would have shown a much higher result for Git last year as well.

There is one other issue to be addressed here. 84% of the respondents to the survey write code in their spare time, so perhaps they are early adopters and innovators after all? In actual fact, this wouldn’t make the slightest bit of difference to the survey outcome for the following reason. Any software development team will contain a mixture of early adopters, of pragmatists, of conservatives, and of laggards. Butthey will all use the same primary source control system. Early adopters in Subversion shops will tick the Subversion box wishing they could be ticking the Git box instead. Mercurial fans in Git shops will tick the Git box wishing they could be ticking the Mercurial box instead. Maybe some people in Git shops will tick the Git box wishing they could be ticking the Subversion box instead. And so on.

The fact remains that these are corporate developers working in corporate shops telling us what their companies are using, not what they are trying to get their companies to use.

Isn’t this an argumentum ad populum?

The implication here is that argumentum ad populum (the idea that the most popular tool is the best) is a fallacy.

This overlooks the fact that at a certain point, increased mindshare does start to produce tangible benefits. Development proceeds faster. More products and services are released that support it. It becomes easier to recruit developers who are familiar with it. It becomes easier to find training for it. The gap between it and the alternatives widens, making it an even more compelling option. The effect becomes self-reinforcing and can even end up with the leading product establishing itself as a standard. Economists call these factors “network effects,” and they are the reason why, for example, the inefficient, uncomfortable and wrist-trashing qwerty keyboard layout still has an iron grip on typing, and we have so much difficulty persuading people to consider technically better alternatives such as Dvorak or Colemak.

We’re seeing this with Git. An increasing number of services are coming online that only support Git: high profile examples include Github and Heroku. Bitbucket introduced Git support back in the autumn, only a year and a half after declaring that it would never do so. Windows Azure has first-class support only for Git and TFS, with neither Subversion nor Mercurial getting so much as a mention. Some of the Git IDEs may still be rough around the edges now, but what will they be like in a year’s time?

Another effect of increasing mindshare is that Git is turning into an industry standard. For open source, it has been the de facto standard for some time now for starters. For some areas, it is even the de jure standard. If you want to do Ruby on Rails development, or Linux kernel development, or jQuery plugin development, or Android development, or Node.js development, for example, it’s simply not up for discussion: you use Git. This may not yet be the case for whatever area of development you are involved with, but it’s only a matter of time.

Don’t tools and languages come and go ridiculously quickly?

One objection was that fashions in software development tools and languages change very quickly and developers are a pretty fickle bunch.

In actual fact, this is only true for languages and tools that are currently in vogue with the cool kids. Once something approaches the top of the mainstream, it’s a completely different ball game.

Let’s consider programming languages as an example. At the moment, there is a lot of excitement around languages such as CoffeeScript, Clojure and Scala. CoffeeScript recently entered the top ten on Github, for instance. However, if you look at the Tiobe Index, you’ll see that these languages are all fairly low down the overall popularity list. Question tags on Stack Overflow and searches of job listings paint a similar picture. The list of top ten programming languages in industry changes at a rate that can best be described as glacial. Tiobe Software noted last month that the only change to their top ten list in the past eight years has been that Objective-C is in and Delphi is out. This is understandable, because once code has been written, it tends to stick around.

Source code management tools are another area where change at the top is slow. Again, you can understand why. Your source control system has been entrusted with the safekeeping of your intellectual property — your assets, your team’s entire commercial value. It also sits at the heart of your processes and infrastructure, and changing it for another system is a major undertaking and not a decision to be taken lightly. When you do change, you do so as a carefully planned exercise spanning months or even years.

For this reason, I didn’t expect Git to poll much more than about 20% or so this year. The fact that it has gone from less than 13% market share to more than 27% in a single year is quite extraordinary, and not to be taken lightly. It’s now up near the top of the mainstream — a position from which it won’t easily be shifted — and if its current rates of growth continue, it’s on course to overtake Subversion to become the most widely used SCM industry-wide within a matter of months.

What results did I expect, and why?

The best possible scenario would have been where Git grew industry-wide at roughly the same rate as Github. Github reached one million users in mid-August, and today, it has grown to just over 1.7 million — a year on year growth of about 90%. If Git usage industry-wide continued at this rate, we would expect it to score about 24% in the survey. However, due to the natural conservatism of corporate development shops, I thought this would be an upper limit — and a pretty unlikely one at that.

On the other hand, if Greg Stein’s analysis proved to be correct, and Git adoption really was hitting a roadblock in corporate settings, I would have expected to see its growth over the past year to have slowed: perhaps somewhere in the region of 16%, mainly because Git has been close to saturation point among high-profile open source projects and Rails shops for quite some time now. Open source projects which have only recently migrated, such as Django and MediaWiki, are fairly late adopters in this respect, and ones that are still clinging to Subversion, such as WordPress and Apache, are notoriously conservative.

The results for Mercurial took me by surprise, however. I expected it to have grown slightly — possibly as high as 6% — or at the very least to have held steady. The fact that it has lost nearly half its users was most disappointing.

What about interoperability tools?

Mercurial and Git do work fairly well together via the hg-git extension, though you may find one or two corner cases where it may not be totally seamless. For example, Git supports octopus merges (where you can merge several branches into one in a single commit) but Mercurial doesn’t, and I’m not sure whether hg-git could handle that consistently. I did also end up with duplicate changesets on one occasion a couple of years ago, though I never got round to looking into exactly why, and it may have been due to a problem that has since been fixed.

Both Git and Mercurial can be used as a front-end to Subversion, and if you are stuck with Subversion I strongly recommend it if possible. However, there are limitations to what you can achieve with these tools, and you lose out on the significant benefits to team workflow that DVCS tools can provide. They are also a very leaky abstraction: Subversion only supports a single line of development on each named branch, for instance, so you will have to make much more extensive use of rebase, which is a riskier and more difficult operation than merging. There are also plenty of ways in which Subversion users can really mess with your day, such as such as renaming a branch, or moving a subtree from one branch to another, or using file externals.

Git can be used alongside TFS with git-tfs, though I wasn’t able to get it to work due to networking issues so I don’t know how well it works.

Should you switch to Git?

My whole point of these posts has been that you can no longer dismiss DVCS out of hand as only being suitable for open source and noisy fanboys, and that you need to take it seriously, no matter how big or small your team. Whether or not you adopt Git wholescale is a different matter that depends on several factors.

As I said, switching your source control system is a major undertaking and not one to be taken lightly. On some existing projects, especially those with a lot of deeply entrenched processes and infrastructure, or long-term contracts in place, it may not even be possible. For projects whose main phase of development is over and which are now in maintenance mode, it’s probably not worth it. In some cases, specialised regulatory requirements may pose additional constraints, though personally I’m sceptical about claims to that effect: contrary to what some vendors will tell you, it’s certainly possible to be ISO9001 or CMMI compliant using Git.

However, it’s becoming abundantly clear now that the writing is on the wall for Subversion. For now, it’s still the most widely used option, and its decline over the past year may have been slower than I expected, but if current trends continue, it will be overtaken by Git industry-wide in about a year’s time. It is a very basic, spartan system even by centralised source control standards and its development is slow. No doubt it will take several years to die off completely (eight percent of developers are still using CVS, believe it or not) but it’s only a matter of time before you will need to plan for its end of life.

Despite its loss of mindshare, I still think Mercurial is worth considering as an alternative to Git. I do wonder how long it can sustain enough momentum to remain viable, but should you need to, switching from Mercurial to Git is almost trivial thanks to hg-git. But certainly for new projects, you need a very convincing reason to stick with old-school centralised source control now. And these reasons are starting to run out.

There is a blog post about Git that I’ve been wanting to write for a while, but I never got round to. In this, I would have expressed concerns that by being unnecessarily hard to use (with a command-line centric culture, borderline incomprehensible documentation, and some surprising, unintuitive behaviours), and by occupying a dominant position within the DVCS scene, Git was putting 9-5 developers off distributed source control altogether and scoring one own goal after another in the battle to displace Subversion.

That post will never get written. In the light of the results of this year’s Eclipse Community Survey, released yesterday evening, it would be patent nonsense. Those fears have been resoundingly shown to be unfounded.

Git’s market share, industry-wide, is now 27.6%.

Twenty. Seven. Point. Six. Percent.

Wow.

That’s more than I expected in the best-case scenario. Based on its growth rate up to now (it scored 12.8% last year and 6.8% the year before), I was expecting Git to score somewhere between 16% and 24% or so, depending on how well it is being received in corporate environments. If my thesis were correct, I’d have expected it to score at the lower end of this range. I thought that 25% was the maximum it could possibly score in the best case, and even then, that was highly unlikely.

(The news is pretty bleak for Mercurial, by contrast: it has dropped from 4.6% to 2.6%. Subversion is still at number 1 for now, but down from 51% to 46%. This is a smaller drop than I expected, but no doubt it’s being shored up by a trickle of late adopters migrating to it away from CVS. Nevertheless, it looks almost certain to lose its number 1 position within the next 12 months.)

Clearly this result is a game changer.

It means that you can no longer dismiss Git’s mindshare as hype.

It means that, as a Subversion or TFS vendor, you can no longer plausibly claim that Git is only suitable for open source development and hobby projects, and not for corporate and enterprise environments.

It means that, as a recruiter, if you are not using Git, you will find yourself facing an increasing number of competitors who are, and a decreasing pool of candidates who are willing to tolerate the alternatives.

It means that, as a developer, if you’re not already thoroughly familiar with Git, you had better learn it. Now.

It means that, as a diehard Mercurial fan, I have finally had to concede that Git has won.

They annoy me because they’re fighting the wrong battle. Git fanatics who say that “Git has won” are so intent on killing off Mercurial that they’ve completely lost the plot with the issue that really matters. It’s old-school, inefficient, restrictive, trunk-based tools like Subversion and TFS that are the problem, not Mercurial.

People who say that “Git has won” point to the success of Github. While this is impressive, it doesn’t give the whole picture: a huge proportion of the industry is still stuck with Subversion, and the majority of corporate developers view the Github crowd as a bunch of arrogant prima donnas who believe that passion==competence and who think that they’re high-end developers simply because they blog, use Twitter, and know Ruby on Rails. Uncle Bob Martin is particularly scathing about people like that. Github is also dominated by developer tools and libraries, and seems to be significantly less popular among authors of userland software as far as I can tell.

Unfortunately, sorting out the facts from the hype isn’t easy. Version control surveys seem to be a bit thin on the ground, and usually have inbuilt biases that skew the picture somewhat. The most reliable ones would probably come from a company such as Gartner or Forrester Research, but I’ve found these a bit hard to pin down too. The most recent one that I could find was this survey from Dr Dobbs/Forrester Research (hat tip: David Richards of WANdisco):

I see no reason to doubt these figures, though they are about three years old now and I haven’t been able to find a more recent repeat of the same survey.

Aside from that, the best I can come up with is the annual Eclipse Community Survey, which is conducted every April. Since Eclipse is an IDE that tends to be widely used in enterprise settings primarily among Java developers, it’s probably the best fit for what I’m looking for, and while it largely filters out the loud Ruby on Rails type fanaticism, it unfortunately also largely ignores the .NET world, which can be infuriatingly conservative at times. However, it does paint a picture in broad brush strokes that gives some indication of how things have been changing since then.

The 2011 survey put Git in third place, just behind CVS (!) in second place with 13.3%. This represents a fivefold increase in two years, which makes it increasingly hard to argue that Git hasn’t yet “crossed the chasm.” The claim that “Git has won,” however, is quite clearly premature, given that Subversion users still outnumber Git users four to one.

Mercurial, coming fourth equal alongside Perforce, has a larger market share than I expected given the demographic: I was under the impression that outside of the .NET ecosystem, it was pretty much a lost cause these days. If you were to factor in .NET developers, its mindshare relative to Git would probably be somewhat higher, since many .NET developers are still dissatisfied with Git’s Windows support and usability story. Certainly, if you’re happy with Mercurial and don’t need to contribute to projects on Github, there’s no need to switch to Git on the basis of mindshare alone at this stage.

Subversion is starting to lose market share, and I expect this trend to continue if not to accelerate over the next year or two, so you should seriously be evaluating a distributed option for new projects sooner rather than later, otherwise you are at risk of being left behind. However, it’s too early to complain about existing projects still using it, especially if they are surrounded by a lot of process and infrastructure making migration difficult.

It’ll be interesting to see what the 2012 survey reveals, but extrapolating these figures would suggest that current market shares are probably somewhere around 18-20% for Git, 6-7% for Mercurial, and 40-45% for Subversion. This would put Git on course to overtake Subversion to the number 1 slot sometime towards the end of next year.