Git ‘Er Done with GitHub (Premium)

I’ve been using GitHub for years to host the Windows 10 Field Guide, and this year I moved my .NETpad projects there as well. But the truth is, I struggle sometimes to understand GitHub---and Git, the underlying version control system---so I thought I’d kind of explain where I’m at and what my plans are for releasing the four different versions of .NETpad I’ve created to the public via GitHub.

So let’s start at the beginning.

Git was created in 2005 by Linus Torvalds to manage the development of his other major creation, the Linux kernel. It’s an open-source version control system, and while it was originally designed, and is still primarily used, for tracking source code changes in programming projects, it can be used to track changes in any set of files. (That’s why we use it for the Windows 10 Field Guide, but more on that in a moment.)

GitHub, meanwhile, is the most popular online service to offer Git version control as a service. GitHub has been part of Microsoft since 2018, and it is basically free and unlimited for any individual, though there are paid plans that offer professional and enterprise services as well.

Where Git gets a bit sticky, at least for me, is the terminology. In Git, what I think of as a project­---typically a folder containing its own subfolder structure and whatever files make up that project---is called a repository. And that’s because a repository also contains meta-data including, among other things, information related to all of the changes that have been made to the files in the repository over time. Repositories can be public, where everyone can see the files, or private. Mine are currently all private.

Once you’ve created a Git repository in GitHub, you access its contained files by cloning the repository locally; in other words, you recreate the repository on your PC. This is the same for programming projects---with which I use Visual Studio for my .NETpad applications---or for the book, which in my case is synced from PC to PC using OneDrive; I update the primary (cloud-based) version of the book repository using Git command-line tools. (Again, more on that in a moment.)

Once a repository is cloned locally, you can access it normally. For my programming projects, this means opening them in Visual Studio projects, and for the book, I see a folder structure of files, many of which are chapter documents in Markdown format or JPEG images. In both cases, I can edit and create new files, and those changes are only reflected locally and not in the primary repository in GitHub.

As the owner of my repositories, I can of course push changes I made locally to the primary repository, a process that is akin to syncing. And I can, on other PCs, pull updates I made elsewhere and added to the primary repository down to a local repository. Each individual change is called a commit. Much of GitHub’s meta-data is dedicated to managing commits and the history of commits.

...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC