"You can use [Git] in ways that you can't in Subversion," which is a centralized 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. (Heroku is a cloud application development platform acquired by Salesforce.com last year.)
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 centralized 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. [But] 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 centralized 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."