Git vs GitHub

February 29, 2024

Overview

Git and GitHub are completely different things. It's not possible to compare them because they serve completely different purposes. However, they can and are used together. Git is version control software and GitHub is the largest host of source code that uses some form of version control.

Table of Contents

What is Version Control?
Git
GitHub
Conclusion

What is Version Control?
^

Version Control software (e.g. Git) are programs that allow you to save the state (called a commit) of your code, as well as branches of different states as it evolves over time. Each repository always has a main, mainline, or master branch. This main branch is often used as the branch that maps to an application's Production environment. Different branches can be used for a variety of reasons, for example:

  • Different branch for different environments.
  • Different branch for different features.

These branches (as well as any commits) can be merged together. Relatively complex algorithms are used to decide how the code is merged together.

Git
^

Git is one brand or design of Version Control software. An alternative (to use a comparison to help illustrate Git) is SubVersion:

GitSubVersion
ArchitectureDistributed Version Control System (DVCS). The repository is cloned onto every developer's machine (with complete history).Centralized Version Control System (CVCS). Single repository stored on a server and users commit changes to it.
Branching and MergingBranching is fast and easy. Frequent branching and merging are encouraged.Branching can be cumbersome.
Storage EfficiencyMore efficient. Git stores changesets (deltas), rather than entire copies of the repository for each commit.Less efficient. Stores an entire copy of each version of each file.
Network AccessMost operations are local. Network access is only needed when a change is ready to be pushed or pulled from the remote storage.Most operations require network access.

Table template created by ChatGPT of OpenAI.

Git is vastly more superior and popular.

GitHub
^

GitHub is a host of repositories. It supports both Git and SubVersion. GitHub is one option for the remote repository mentioned above. It also provides features to support collaboration within teams, for example:

  • Access control.
  • Feature requests.
  • Task management.
  • Wikis.
  • Web-based graphical interface to view branches, commits, pull requests, issues (including bug tracking).

One of the best features of GitHub is how well it's integrated into so many other applications, tools, frameworks, and platforms. For example:

  • CI/CD platforms.
  • Project management platforms.

Some CI/CD, project management, and other tools are able to integrate with GitHub so well that build pipelines are triggered by git changes. Similarly, tasks can automatically move from one column in a work tracking board to another.

GitHub is also responsible for Copilot, a generative coding assistant.

Conclusion
^

While distinct in their functions (with zero overlap), Git and GitHub fit together perfectly to create a powerful ecosystem for software development. GitHub's hosting of millions of repositories provides a powerful source for data if one is so inclined to sift through it all programmatically. It has become a tree trunk of opportunities for other applications that integrate with it to branch out of.