June 2017

Volume 32 Number 6

[Editor's Note]

Grokking Git

By Michael Desmond | June 2017

Michael DesmondBack in the August 2016 issue, MSDN Magazine published a feature by Jonathan Waldman titled “Commit to Git: Source Control in Visual Studio 2015” (msdn.com/magazine/mt767697). That article went on to be among the 10-most-visited feature articles for all of 2016, based on first-month page views, and was the most-trafficked DevOps-themed article we’ve ever published.

Clearly, Git struck a nerve with readers. So when Waldman pitched a two-part exploration of Git internals for Visual Studio developers, it didn’t take me long to say yes. Working closely with Microsoft experts Kraig Brockschmidt and Ralph Squillace, Waldman’s first part of the series, “Git Internals for Visual Studio Developers,” explores the version control system (VCS) and how it differs from the traditional, centralized VCSes familiar to most Windows developers.

Waldman began using Git as his VCS with Visual Studio 2013 and, he says, “grew to love working against a decentralized repo.” But he faced a learning curve as he experimented with Git and pieced together guidance and resources. When Microsoft released enhanced Git support with Visual Studio 2015, Waldman dove right in, eventually writing his Commit to Git feature article in MSDN Magazine based on his experience.

“There’s been a dearth of good material about Git for the Microsoft technology professional,” he says, noting that most Git tutorials and instruction rely on the Unix shell command-line interface. “I think MSDN Magazine readers enjoyed finally seeing material about Git that leverages the Windows-based Visual Studio IDE and PowerShell/Command Prompt command-line interfaces.”

Along the way, Waldman realized that developers who understand the directed acyclic graph (DAG) used to store commit objects in Git are in much better position to grasp advanced Git operations and concepts. He learned also that developers often misunderstand what a Git branch is and how it works. In fact, a large part of the challenge in grokking Git boils down to vocabulary, where familiar terms like check in/check out, branch and merge represent approaches different from those in a centralized VCS.

“I think it’s essential to first understand the repo from Git’s perspective, using a purely repo-centric vocabulary. Once you do that, you realize that Git simply stores and manages commit objects on a [DAG], and that’s all,” Waldman says. “Everything else has to do with user-initiated actions that compare or manage those objects. And when it comes to describing those actions, it is critical for team members to adopt a lean Git vocabulary with clear definitions and then use it formally and consistently.”

Waldman’s two-part exploration this month and next aim to break down these barriers. This month’s article introduces the Git DAG and explores commit objects and branching. Next month, Waldman plans to extend his coverage to what he describes as “foundational knowledge” about Git.

“I plan to explore exactly what happens when you check in and check out code—with particular emphasis on Git’s three-tree architecture,” Waldman says. “I’ll also cover how Git detects code changes, and provide additional details about branching and merging.”


Michael Desmond is the Editor-in-Chief of MSDN Magazine.


Discuss this article in the MSDN Magazine forum