Developers flock to Linus Torvald's Git code version control system
Subversion and Mercurial remain in the game despite success
By Paul Krill | InfoWorld | Published: 15:30, 26 July 2011
Git, the open source distributed software version control system pioneered by Linux founder Linus Torvalds in 2005, is now gaining real momentum with developers. But don't count out rivals like Mercurial and the still dominant Apache Subversion platform.
In the past three years, the Eclipse Community Survey on open source development has seen Git grow from 2 percent adoption in 2009 to nearly 13 percent this year, says Forrester analyst Jeffrey Hammond, who has assisted with the survey. "Pretty impressive," he says. "It's one of the reasons Eclipse has adopted Git as a supported alternative to Subversion for Eclipse projects."
Git also is gaining in adoption among the Ruby community, open source projects and younger developers, Hammond says. "There's a joke on our team: Show me a developer under 24 and I'll show you a Git user." IDC analyst Al Hilwa also sees the growth spurt: "It appears to have taken the world by a storm. Of late, it sure appears that Git is being used more than its competitors for open source projects."
Torvalds cites a change in attitudes as assisting with adoption of distributed version control and Git.
"I think what has happened is that it took even kernel people a few years to get used to the whole distributed model, and now a lot of the people who were early adopters both inside and outside the kernel community have caused the model to become much more widely known and understood," he says. "Once you really understand the things that a truly distributed model like Git brings to the table, you really are never going to go back to the centralised model."
Torvalds says he designed Git when BitKeeper, which also offered a distributed source control model, became what he described as "politicised." His three main design goals included support for true distributed software development, strong data safety and strong performance.
Git's advantages over Subversion and Mercurial
"Git has been gaining share for open source development largely because of its distributed architecture. It is designed by Linus Torvalds and used for Linux itself, so that gives it great credibility," says IDC's Hilwa. "Being distributed and having a native command line interface does not make it easy, but there are plugins for the major IDEs."
"The Android project, for example, has been a really big driver of Git adoption because it uses Git to take contributions," notes Scott Chacon, a Git evangelist. Large telecommunication companies must now use Git to participate in Android development, he adds.
So what's so great about Git? For one, "you can have multiple nodes" and push changes to them, Chacon says. He is part owner of GitHub, which provides a hosting platform for Git that has about 830,000 users. He estimates the number of Git users to be in the millions.
"You can use Git in ways that you can't in Subversion," which is a centralised version control system, Chacon says. For example, developers can work offline and do not have to be connected to the server at all times. Compared to Subversion, Git "improves the efficiency of developers. The branching system is hugely superior, and it makes workflows that are a lot of better for development and for team collaboration." It also is fast and cryptographically secure, he notes.
Git is very similar to the Mercurial distributed version control system, Chacon says, but Git has a stronger community around it. "Git has a larger user base right now. GitHub only supports Git and Heroku only supports Git," he says.
Given Git's many advantages, Eclipse is making Git its preferred version control system, a move inspired by developers and members. "[For] all new projects, we highly recommend that they start with Git, and we're encouraging existing projects to transition, but we're not forcing projects to switch," says Mike Milinkovich, Eclipse's executive director.
Git, he says, makes it easier to accept code contributions from outside the community: "Just the mechanics of the process of somebody pushing a change to Eclipse is a lot easier than what we had in the past." Previously, developers had to attach a patch and apply it in CVS. Git's distributed nature also simplifies the process of having multiple people and projects committing changes, Milinkovich says. "It makes it simpler to experiment and merge those experiments back together into the main line."
Despite Git's fast rise, rivals still have significant market share
It's true that Git adoption has increased sixfold in three years, but Eclipse's 2011 survey of 704 developers still has Subversion as the source code management system of choice, with 51.3 percent of respondents using it. CVS, also a centralised system, comes in second at 13.3 percent. Git follows with 12.8 percent, while Mercurial was used by 4.6 percent.
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. I don't know if it's necessarily true that a lot of corporate development shops are switching [to Git]," he says.
He says Subversion is better at handling large binaries and large repositories than Git is. For example, for large code bases, Git repositories have to be copied to every workstation, which can be difficult when developers have to deal with hundreds of gigabytes, says Stein. Chacon concedes that using Git to version control very large software assets, such as videos, can present problems, but he advises using an asset management system along with Git in such cases.
Stein says that Subversion's centralised repository scheme requires tighter collaboration across a team, which should result in better code. He also notes that the upcoming Subversion 1.8 release should bring it closer to Git's capabilities, with features like Git stash, in which a developer can make changes locally and then set them aside, and offline commits, which records completed changes when a developer is offline and moves the to the master repository when the developer reconnects.
Mercurial, which is open source like Git and Subversion, is more similar than different from Git, says Matt Mackall, Mercurial's primary author and project leader. "They're both designed for speed and they're both inspired by the design of an earlier system called Monotone, so they have a lot in common architecturally."
However, he says, Mercurial is generally designed to be easier to use. "If you're coming from CVS or SVN, it should seem fairly familiar. Mercurial wins some performance benchmarks and Git wins others. Windows folks tell me Mercurial works much better there." Mackall believes both projects have similarly strong communities, with both being sizable, diverse, and active.
Git is on a roll, but has a long way to dominance
Git has gained a lot of important adherents, with major adopters including the Ruby on Rails project, the Debian OS effort and the Linux kernel. Developers clearly are taking a liking to the platform. But there are still plenty of users of other technologies, such as Mercurial and Subversion, as Eclipse's survey reveals.
Whether Git can maintain its momentum long enough to dominate and perhaps become an industry standard before some other technology comes along remains to be seen. But for now at least, Git is on a roll.