Microsoft Corp. MSFT 0.66% is buying the software-code repository GitHub Inc. for $7.5 billion in stock, a move that could help the software giant persuade more developers to create applications for its cloud-computing business.
The deal puts GitHub, a popular service where developers share and collaborate on code, into the hands of a tech giant that is among the leaders in cloud computing, where customers rent digital resources and applications on demand.
Three years ago, GitHub raised $250 million from several venture-capital firms, a move that valued the company at $2 billion at the time. Its investors include Sequoia Capital, Institutional Venture Partners and Andreessen Horowitz, among others.
GitHub is particularly popular with open-source developers, a community that shares code that can be changed and improved by others—and that Microsoft has taken pains to court.
Since taking over in 2014, Chief Executive Satya Nadella has shifted Microsoft’s open-source strategy, opening up its database program to work with Linux, for example.
His approach offers a contrast to that of his predecessor, Steve Ballmer, who once called Linux a cancer because of its threat to intellectual-property rights.
Microsoft’s embrace of Linux is another a sign the company under Mr. Nadella is moving past the Windows era. In March, the CEO reorganized the company around its growing Azure cloud-computing operations and its Office productivity business, downgrading the role of Windows.
Microsoft has long counted developers among its most important constituents. The company became the dominant tech power in the 1990s in large measure because developers chose to build their applications for its Windows operating system.
Microsoft, though, is playing catch-up in the cloud-infrastructure market to Amazon.com Inc., which has its own loyal following of partners who build applications for the service. GitHub could lure developers to create services that help makes Azure more appealing to customers.
“Developers are the builders of this new era, writing the world’s code. And GitHub is their home,” Mr. Nadella said in a blog post.
The website has become an important piece of the open-source development process, with more than 28 million developers working on code that sits in 85 million storage spaces, called repositories, according to Microsoft.
Corporate customers pay to use GitHub to host and run software projects, a service that includes security and identity-management features. GitHub, which is privately held, doesn’t disclose financial data. Its sales likely are paltry relative to the $109.54 billion in revenue analysts expect Microsoft to report for its fiscal year ending this month.
In his blog post, Mr. Nadella said the company plans to “accelerate enterprise developers’ use of GitHub” by selling the service through Microsoft’s sales channels. He also expects GitHub to bring Microsoft’s developer tools and services to new customers.
According to Microsoft, it has become the most active organization on GitHub, which also is used by Alphabet Inc.’s Google, Apple Inc. and others.
“It is a very unique community that seems difficult for anyone else to replicate,” said Stifel Nicolaus & Co. analyst Brad Reback.
Two years ago, Microsoft made a similar acquisition. It bought Xamarin Inc., a San Francisco maker of software development tools, to help developers who use Microsoft products build apps for Apple Inc.’s iOS and Google’s Android mobile operating systems. That deal has helped Microsoft build a stronger presence on devices that don’t run Windows.
Xamamin founder Nat Friedman, a Microsoft vice president, will become GitHub CEO. GitHub’s current CEO, Chris Wanstrath, will become a Microsoft technical fellow. Last August, Mr. Wanstrath announced plans to step down, though the company hadn’t replaced him.
Microsoft said developers will continue to be able to use the programming languages, tools and operating systems of their choice on GitHub, and will still be able to deploy their code on rival cloud services and devices.
The company expects the deal to close by the end of the year.
The GitHub acquisition also bears some similarity to Microsoft’s $2.5 billion purchase of Mojang AB, the company behind the videogame Minecraft, another widely used product with a passionate base of users.
Corrections & Amplifications
Microsoft said it would acquire GitHub for $7.5 billion in stock. A summary for the story that appeared on WSJ.com erroneously said the acquisition was for $7.5 billion in cash. (June 4)
Write to Jay Greene at Jay.Greene@wsj.com