SAN FRANCISCO – When the founders of GitHub moved into their swank South-of-Market loft last year, the first thing they did was redecorate. They turned the floor's biggest office into a parody of an executive suite – complete with fake fireplace, plush leather chairs, and a wooden globe that slides open to reveal a bottle of single malt scotch. Hanging from the wall is a painting of a cat, dressed as Napoleon, with five octopus-like legs. They call it the Octocat.

The point is that it's not an executive suite. It's a communal meeting room where anyone can hang out with anyone else, get some work done, and have a little fun at the same time.

"Everybody can bring their friends into that room and sort of impress them and stuff," says Scott Chacon, GitHub's CIO co-founder. You see, Chacon and CEO Chris Wanstrath and the rest of the executive team don't have private offices. They work on the open floor next to the coders, glued to monitors with the rest of the staff, listening to LCD Soundsystem. Loud.

GitHub's geektastic 14,000-square-foot loft mirrors its mission: to democratize computer programming. GitHub.com is best thought of as Facebook for geeks. Instead of uploading videos of your cat, you upload software. Anyone can comment on your code and add to it and build it into something better. The trick is that it decentralizes programming, giving everyone a new kind of control. GitHub has shaken up the way software gets written, making coding a little more anarchic, a little more fun, and a lot more productive.

And the software world loves it. GitHub now has more than 1.3 million users, and over 2 million source code repositories – eight times the tally from just two years ago. If you count snippets of code and Wiki pages that are stored on the site, there are more than 4 million repositories. Two years ago, GitHub was a team of eight, holding company meetings in San Francisco cafes. By the beginning of 2011, they'd grown to 14 "hubbernauts" – as GitHub employees are affectionately called – and a year later, they're at 57. In July, they took over the former digs of blogging outfit Six Apart. GitHub is growing fast – and it hasn't taken a dime of venture funding.

Once you've heard about GitHub, you start to see it almost everywhere. Sometimes, it's hosting the code that underpins a big-name website. Other times, it's driving a secret skunkworks project inside a Fortune 500 company. It has brought open source software that much closer to fulfilling its promise – but it doesn't stop there. It's also democratizing the creation of web pages and DNA analysis tools and maybe even the law of the land.

"GitHub has changed the way that people approach development," says Tom Preston-Werner, the company's chief technology officer. "They realize that it doesn't have to be so complex."

Git Scratches Itch

Like so many other successful geek projects, GitHub began with coders scratching their own itch. About five years ago, Wanstrath and fellow programmer P.J. Hyett were both slinging code at Cnet, the tech news and reviews site. Their language of choice was Ruby on Rails, a programming framework that makes it easy to develop Web applications.

__Why Git?__It's the British slang term for stupid, despicable person – arse. The joke "I name all my projects for myself, first Linux, then git" was just too good to pass up. But it is also short, easy-to-say, and type on a standard keyboard. And reasonably unique and not any standard command, which is unusual.–Linus TorvaldsAs they built out their sites at Cnet, Wanstrath and Hyett wound up making a lot of improvements to Ruby on Rails itself. But they found it wasn't so easy to get those changes integrated back into the open-source project. Following the then-dominant model of open source development, Rails was managed by a cadre of trusted coders who’d been given permission to “commit” changes to the project's source code. To get one of their changes added to the central code, Wanstrath and Hyett would have to lobby one of those trusted coders and convince him that their change was worth integrating. That was often more work than writing the code in the first place.

They weren’t the only developers chafing under that Trusted Gatekeeper model of open source. A decade ago, Linus Torvalds found himself struggling to manage his role as gatekeeper of the Linux operating system he invented. In the beginning, Torvalds hosted Linux on a website belonging to the University of Helsinki. If people found a bug in the code, they'd send him a file with the changes via e-mail. If Torvalds read the e-mail and liked the changes, he'd incorporate them into Linux. But Torvalds is notorious for not reading all of his e-mail, so as the project got popular, more and more submissions were slipping through the cracks.

This was the dirty little secret of open-source software. With the average free software project, large amounts of code – maybe even most code – never actually got used. It was often just too hard for casual users to show developers the changes they'd made and then easily merge those changes back into the open-source code base.

The Second Coming of Linus

So in 2005, Torvalds created Git, version control software specifically designed to take away the busywork of managing a software project. Using Git, anybody can tinker with their own version of Linux – or indeed any software project – and then, with a push of a button, share those changes with Torvalds or anyone else. There is no gatekeeper. In practical terms, Torvalds created a tool that makes it easy for someone to create an alternative to his Linux project. In technical terms, that's called a “fork”.

Back in the 1990s, forking was supposed to be a bad thing. It's what created all of those competing, incompatible versions of Unix. For a while, there was a big fear that someone would somehow create their own fork of Linux, a version of the operating system that wouldn't run the same programs or work in the same way. But in the Git world, forking is good. The trick was to make sure the improvements people worked out could be shared back with the community. It's better to let people fork a project and tinker away with their own changes, than to shut them out altogether by only letting a few trusted authorities touch the code.

On a rare sunny February day in Portland, Torvalds demonstrates Git for Wired at his home office. With a few keystrokes, he quickly spots two new kernel submissions that change the same kernel code in different ways, a potential problem source.

The old regime "makes it very hard to start radical new branches because you generally need to convince the people involved in the status quo up-front about their need to support that radical branch," Torvalds says. "In contrast, Git makes it easy to just 'do it' without asking for permission, and then come back later and show the end result off – telling people 'look what I did, and I have the numbers to show that my approach is much better.'"

It may have been built for Linux, but Git quickly proved to be a godsend for any large organization managing giant code bases. Today, Facebook, Staples, Verizon and even Microsoft are users. At Google, Git is so important that the company pays Junio Hamano – who took over the project from Torvalds – to work on Git fulltime, and also pays the salary for the project's second-in-command, Shawn Pearce.

Git Without the 'Pain in the Ass'

The problem is that not everyone is Linus Torvalds, and not every company is Google. For the 99 percent, Git’s command-line interface is notoriously difficult to use. That’s where GitHub comes in. It simplifies Git. A lot. Its first slogan was: "Git hosting: No longer a pain in the ass."

Tom Preston-Werner dreamed up GitHub and roped Chris Wanstrath into the project one night in October 2007 at a coder's meet-up at Zeke's, a San Francisco sports bar a few blocks from the downtown stadium where the San Francisco Giants play.

At first, GitHub was a side project. Wanstrath and Preston-Werner would meet on Saturdays to brainstorm, while coding during their free time and working their day jobs. "GitHub wasn't supposed to be a startup or a company. GitHub was just a tool that we needed," Wanstrath says. But – inspired by Gmail – they made the project a private beta and opened it up to others. Soon it caught on with the outside world.

By January of 2008, Hyett was on board. And three months after that night in the sports bar, Wanstrath got a message from Geoffrey Grosenbach, the founder of PeepCode, an online learning site that had started using GitHub. "I'm hosting my company's code here,” Grosenbach said. “I don't feel comfortable not-paying you guys. Can I just send a check?"

It was the first of many. In July 2008, Microsoft acquired Powerset, the startup that was providing Preston-Werner with a day job. The software giant offered Preston-Werner a $300,000 bonus and stock options to stay on board for another three years. But he quit, betting everything on GitHub.

"It was a little scary at the time to give up something like that, but I would not change anything about that decision at all," he says now.

When Wired visited GitHub's offices earlier this year, we found a bit of a geeks' paradise. There's an iPhone-controlled quadcopter and a four-tap kegerator, and a conference room that's a low-budget knockoff of the White House's situation room, complete with a massive 1970's style red phone. But the toys aren't what makes GitHub different. It's the startup's outright hostility toward corporate command-and-control that really sets it apart.

"We don't keep track of vacation days; we don't keep track of hours. It doesn't matter to us," says CIO Scott Chacon. "I've been here at midnight and there are five people here. And I've been here in the middle of the day on a Thursday and there's nobody here."

And yet it's the most productive software development team he's ever worked on, Chacon says.

Git to the Future

Preston-Werner's bet has paid off. GitHub is now profitable. Users can sign up for free and start contributing, but they pay money if they want to privately host code there – starting at $7 per month. GitHub also sells an enterprise product that lets companies run their own version of GitHub behind the corporate firewall. That starts at $5,000 per year, but can cost hundreds of thousands annually for companies with hundreds of coders.

Ironically, though, GitHub’s die-hard fans don’t include Torvalds, who briefly moved Linux kernel development to GitHub last September following a security breach at its old home.

"I like GitHub a lot,” he says. “There's a reason it became one of the biggest source code repositories rather quickly.” But he then unfurls a long list of all the "serious" problems he had with it when he hosted his code on the site – many of which have since been fixed. He couldn't filter comments, the e-mail interface dropped attachments, the web interface messed up code contributions, and so on. The bottom line: GitHub makes it easy to code. But it can also make it easy to generate crap.

That may be true, but it hasn't held the site back. GitHub users are seemingly everywhere. On a recent afternoon in San Francisco's North Beach neighborhood, Wired was discussing the site with GitHub director of engineering Ryan Tomayko. Suddenly the guy at the next table leaned over and interrupted, like a teenager overhearing two strangers talk about his favorite band. "I just have to tell you," he said, "GitHub is amazing."

It's even feeding the Occupy movement. When Jonathan Baldwin wanted to write a cell-phone version of the People's Microphone, used by Occupy to pass messages around big crowds, he posted his code straight to GitHub. The site let him share his code easily, and quickly connect with other developers to hammer out technical issues. "GitHub is the best thing ever. If you don't host on GitHub, it doesn't exist," says Baldwin, a student at Parsons the New School for Design in New York.

And software is only part of the story. Geeks are learning that GitHub can help manage other projects as well. Books and even transcripts of talks have popped up on the site. One GitHub user, Manu Sporny, published his DNA information to the site last year, in the hope of spurring development of open-source DNA analysis software by providing real test data to analyze.

When Scott Chacon wrote a book about Git, the first fork appeared within a month. It was a German translation of his book. Now, three years later, it's been translated into 10 languages, with another 10 translations in the works. Half of the traffic to the book's website comes from China. "Tons of people in China are learning Git because they can read [the book] in Chinese on my website, because somebody provided that," he says.

Ryan Blair, a technologist with the New York State Senate, thinks it could even give citizens a way to fork the law — proposing their own amendments to elected officials. A tool like GitHub could also make it easier for constituents to track and even voice their opinions on changes to complex legal code. "When you really think about it, a bill is a branch of the law,” he says. "I'm just in love with the idea of a constituent being able to send their state senator a pull request."

GitHub today is the darling of the open-source world, but this year, the company has set its sights on Microsoft. The company recently hired a pair of developers from the software giant, and it's working on new software to rope in the still-considerable army of coders who write programs using Microsoft's software development tools.

"I want to live in a world where it's easier to work together than to work alone... where every part of the software development process is a joy," says CEO Wanstrath. "And I think GitHub can help make that happen."

Editor's Note: This isn't just a story. Wired has also published this article as a Git repository on GitHub. Fork it, update it, translate it, send us a pull request.