Getting Introduced to Git and GitHub

Published: 2022 July 01

Last edited: 2023 October 19

software development Git GitHub technical guide

Introduction

This post is part of a series about Git and GitHub.

Git and GitHub are two related but separate tools that are helpful for software development, as well as many other things.

They are both flexible and powerful, which makes them very useful.

But that flexibility and power come from some complex features and interactions that can also make them seem intimidating at first. They do not need to be intimitidating, however. Even when you are just starting to learn Git, the core features are understandable.

While some aspects of both tools are complex, many are simple to use. And like many tools, they don’t have to be mastered to be very helpful. You can start using both tools with a very basic understanding of just a few commands and expand your knowledge as you have need or opportunity.

Let’s start by understanding what each of these tools are for.

What is Git?

From Wikipedia’s entry for Git:

Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).

Git was originally authored by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development. Since 2005, Junio Hamano has been the core maintainer. As with most other distributed version control systems, and unlike most client–server systems, every Git directory on every computer is a full-fledged repository with complete history and full version-tracking abilities, independent of network access or a central server. Git is free and open-source software distributed under the GPL-2.0-only license.

And from Git’s homepage:

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Finally, from Seth Kenlon:

Git is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it’s best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized.

So, Git is free and open source software for version control that’s designed to be flexible, fast, and reliable and can be used in many situations.

What problems does Git solve?

Let’s look at the question, “What is version control software?”

According to Gitlab.com:

[Version control]… tracks changes to a file or set of files over time.

If you’ve ever saved multiple versions of a paper you were writing or a file you were updating you have probably seen how it can become tedious and confusing to keep track of multiple files. This only becomes more complicated if you are working with other people on the same document.

Version control software attempts to make this process simpler and faster.

That is what Git was built to help with.

Both the videos What is Git? by Programming with Mosh and What is Version Control? by Tower help illustrate that key idea.

What is GitHub?

From Wikipedia’s entry for GitHub:

GitHub, Inc. is a provider of Internet hosting for software development and version control using Git. It offers the distributed version control and source code management (SCM) functionality of Git, plus its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, continuous integration, and wikis for every project. Headquartered in California, it has been a subsidiary of Microsoft since 2018.

It is commonly used to host open-source projects. As of November 2021, GitHub reports having over 73 million developers and more than 200 million repositories (including at least 28 million public repositories). It is the largest source code host as of November 2021.

And from GitHub’s documentation:

GitHub hosts Git repositories and provides developers with tools to ship better code through command line features, issues (threaded discussions), pull requests, code review, or the use of a collection of free and for-purchase apps in the GitHub Marketplace. With collaboration layers like the GitHub flow, a community of 15 million developers, and an ecosystem with hundreds of integrations, GitHub changes the way software is built.

GitHub builds collaboration directly into the development process. Work is organized into repositories where developers can outline requirements or direction and set expectations for team members. Then, using the GitHub flow, developers simply create a branch to work on updates, commit changes to save them, open a pull request to propose and discuss changes, and merge pull requests once everyone is on the same page.

And as TechCrunch summarized:

GitHub is a Git repository hosting service, but it adds many of its own features. While Git is a command line tool, GitHub provides a Web-based graphical interface. It also provides access control and several collaboration features, such as a wikis and basic task management tools for every project.

From GitMadeEasy

Github is a cloud-based git repository hosting service. This means it’s an online database that allows you to keep track and share your git version control projects outside your local machine.

From Pedro Rijo

GitHub can be seen as a Git server as a service.

What problems does GitHub solve?

From TechCrunch:

[B]efore GitHub, if you wanted to contribute to an open source project you had to manually download the project’s source code, make your changes locally, create a list of changes called a “patch” and then e-mail the patch to the project’s maintainer. The maintainer would then have to evaluate this patch, possibly sent by a total stranger, and decide whether to merge the changes.

GitHub offers a central place to host Git repositories, which makes it easier to collaborate on those repositories.

Additionally, GitHub offers community and colloboration tools that support teams working on Git repositories.

These features make it easier for teams to work together on projects using Git.

How do Git and GitHub compare?

GeeksForGeeks offers an excellent tabular comparison of the basic characteristcs of Git and GitHub.

How do Git and GitHub work together?

From a StackOverflow answer

Git is a revision control system, a tool to manage your source code history.

GitHub is a hosting service for Git repositories.

From GeeksForGeeks

Git: Git is a distributed version control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

GitHub: GitHub is a web-based Git repository hosting service, which offers all of the distributed revision control and source code management (SCM) functionality of Git as well as adding its own features.

One of the key benefits of Git is that it is decentralized, but this can create challenges for collaboration.

One of the key benefits of GitHub is that it is a centralized host for decentralized Git repositories.

In short, using Git with GitHub allows people to use Git in a centralized way when they want and a decentralized way when they don’t.

That’s what makes the combination of Git and GitHub so powerful:

How do I get started with Git and GitHub?

We look at that question in our next post: Getting Started with Git.

And to find a curated list of many more resources for learning about Git you can review our Git and GitHub Topic post.

Copying Directory Structure With a Bash Script - With Help From ChatGPT AI

Published: 2024 January 22

Backing Up Git Config Values With a Bash Script

Published: 2023 August 25

Backing Up Visual Studio Code (VS Code) Settings and Extensions With a Bash Script

Published: 2022 November 09