What is the Difference Between Git and GitHub? 

Reading Time: 4 minutes

What is Git?

gitlogo

Git is a distributed version control system (or VCS), typically used to track files changes. It was developed in 2005 by Linus Torvalds, the creator of the Linux kernel. Git’s primary use is to keep track of changes within source code during the software development process. Source Code Management or SCM was the primary reason for its creation.

Git is not the only available VCS, but it certainly is the most popular ones. This is primarily due to it being a free, open-source, multi-platform, highly integrable, and relatively simple platform to use. In this article, we will learn a bit about version control systems and what Git and GitHub are. We will also review how they work together. At its core, a version control software allows us to keep track of code changes. This way, we can see and evaluate the differences between multiple iterations or revisions of files.

Here is a typical use case. Let’s say we created a website and it’s working fine, even after a few updates! One day, we make some small changes to the site, and suddenly, it breaks. Typically, we would have to remember all the changes we made in the previous update. Then, go back and revert them all manually. Git, on the other hand, shows us exactly what changes we made including which files. This makes it much easier to track down the problem. We could also directly reverse the earlier changes and revert any updates which may have caused the issue. To accomplish this, Git uses repositories. 

What is a Git Repository?

A Git Repository (or repo, for short) is essentially the folder where our project is located. It also includes a .git directory containing all of our project files’ revision history. There are two types of repos:

  • Local repository — This folder contains all the files on our local computer where we do our work.
  • Remote repository — This is an off-site repository. It is usually located on the server where our project lives. It may also reside on a repository hosting service like GitHub.

Using remote repositories is one of the critical functionalities of Git. It expands on its use as a VCS and turns it into a collaborative tool. Complex projects usually have multiple people working on them. A remote repository stores our shared project code in one location. Additionally, it also keeps track of who made what changes and when. 

git-github

Distribution

We mentioned earlier that Git is a distributed VCS. To explain this concept, we need to take a look at two other types of version control systems:

  • Local VCS: This is the earliest and most basic form of VCS. Usually, these are simply a database that keeps track of changes made to a set of files on a local computer. These do not work very well when multiple developers are working on a project.
  • Centralized VCS This is a step up from a local VCS. The project and its version database are kept in a single location, typically on a server. Collaborators can “check out” the files they need to work on. This is similar to checking out a book from the library. Assuming libraries allowed you to modify and update the contents of a book. 

However, should the central server become unavailable or fail, the whole project is halted or lost. Unless a backup system is in place, distributed VCS’s come into play. Using Git or another DVCS, each user’s local repository contains a full copy of all the project files. It also contains the entire revision history. Every user has a complete backup of the data. Should any critical failures occur, the project can be quickly restored. 

Branching

Another essential feature of VCS is branching. Branching is defined as separating work from the main project to modify project code without impacting the main (master) branch. This feature is especially useful when testing and implementing new features, or trying alternative solutions for a problem or task. If that branch is improved, it then will be applied to the master branch, and merged into it. The Git branching system is renowned for being lightweight and quick. In fact, branching and merging is encouraged as part of the workflow.

What is GitHub?

GitHub is a repository hosting service. While we haven’t covered specific git commands or workflows in this particular article, we should note a few critical points:

githubloogo
  • Git is a standalone software that needs to be installed. The installation will differ between different operating systems. It is best to check what needs to be done to get Git up and running on our specific system.
  • Git is often used via the CLI (Command Line Interface). Both built-in and third-party GUI (Graphical User Interface) tools are also available.
  • Another popular way of using Git is directly through a text editor or IDE. Many IDEs natively support Git. Others may require the installation a plugin or adding an extension. A few examples of this are:
    • Sublime
    • Atom
    • NetBeans
    • Eclipse
    • Microsoft Visual Studio
    • Visual Studio Code
    • Notepad++
    • VSCodium

Repositories

When working on a project independently, using Git and setting up a remote repository is always a good idea. It is better to have a revisioning system to use as a backup, then to waste time rebuilding lost data.

We should also keep in mind whether we want our project to be publicly available (open-source) or private. GitHub offers both options as a means to either share your code or keep it confidential

Conclusion

To answer our original question What is the difference between Git and GitHub?

The simple answer is that Git is a version control system which lets us manage and track the history of our source code. GitHub is the cloud-based storage medium which allows us to keep those changes in a remote repository. Using both Git and GitHub together is a sensible choice for maintaining the ongoing development of a code base.

Learn More

We pride ourselves on being The Most Helpful Humans In Hosting™!

Our Support Team is full of experienced Linux technicians and talented System administrators who have intimate knowledge of multiple web hosting technologies, especially those discussed in this article.

Should you have any questions regarding this information, we are always available to answer any inquiries with issues related to this article, 24 hours a day, 7 days a week 365 days a year.

If you are a Fully Managed VPS server, Cloud Dedicated, VMWare Private Cloud, Private Parent server, Managed Cloud Servers, or a Dedicated server owner and you are uncomfortable with performing any of the steps outlined, we can be reached via phone @800.580.4985, a chat or support ticket to assisting you with this process.

The Top 5 Git Best Practices For Success

Reading Time: 4 minutes

What is Git?

31920.github

Git is the most commonly used VCS (Version Control System) today. Git is a free distributed version control system used for tracking changes in source code during development. It is installed and maintained on your local system. It is designed mainly for orchestrating work among developers. But, it can also be used for tracking changes in any set of files.

We can commit your work locally, and if everything is working as expected, it can be synced on the server. Because of Git’s popularity, help is easy to get when it’s needed. Also, the Git community has many resources for learning Git online. 

Continue reading “The Top 5 Git Best Practices For Success”

How to Commit and Push Changes from Ubuntu 18.04 to GitHub

Reading Time: 2 minutes

In our previous tutorial, we showed you how to create and sync a GitHub repository to your Ubuntu VPS server.  Using the last tutorial as a springboard, we’ll continue on and show you how to commit and push a script from your Ubuntu server to your GitHub account.

Continue reading “How to Commit and Push Changes from Ubuntu 18.04 to GitHub”

How to Install Pyenv-virtualenv on Ubuntu 18.04

Reading Time: 3 minutes
python-logo

Pyenv is an outstanding tool for managing multiple Python installations. Pyenv-virtualenv is a pyenv plugin that facilitates the creation and management of Python virtual environments with pyenv. This is a compelling proposition, making it possible to manage multiple Python versions with pyenv and provide the means to control the Python environment in a more granular manner.

Continue reading “How to Install Pyenv-virtualenv on Ubuntu 18.04”

How to Install Pyenv on Ubuntu 18.04

Reading Time: 3 minutes

What is Pyenv?

Pyenv is a fantastic tool for installing and managing multiple Python versions. It enables a developer to quickly gain access to newer versions of Python and keeps the system clean and free of unnecessary package bloat. It also offers the ability to quickly switch from one version of Python to another, as well as specify the version of Python a given project uses and can automatically switch to that version. This tutorial covers how to install pyenv on Ubuntu 18.04.

Continue reading “How to Install Pyenv on Ubuntu 18.04”

How to Install and Configure Apache Maven on Ubuntu 18.04

Reading Time: 3 minutes

What is Apache Maven?

Apache Maven is one of the most popular build management tools for Java projects. It employs a Project Object Model or POM utilizing an XML file to define the structure of a project, including its dependencies, documentation, and build parameters. Instead of having to manage those things individually, Maven consolidates that functionality allowing for a more streamlined and efficient project management process. In this tutorial, we are going to cover how to install Maven on Ubuntu 18.04.

Continue reading “How to Install and Configure Apache Maven on Ubuntu 18.04”

How to Install and Use Containerization

Reading Time: 6 minutes

What is Containerization?

Containerization is a form of virtualized operating system developed as a response to the many problems of hardware-level virtualization. Because the latter runs a full-blown guest operating system, it is very resource-intensive and incurs a significant amount of overhead, but containerization is much lighter. Since the containers share the host machine’s kernel, the resources are not wasted on running separate operating system tasks. This allows for a much quicker and lightweight deployment of applications.

Continue reading “How to Install and Use Containerization”

How to Install and Correct Dependencies Issues in Ubuntu

Reading Time: 6 minutes

What is a Dependency?

A dependency is defined as a file, component, or software package that a program needs to work correctly. Almost every software package we install depends on another piece of code or software to work as expected. Because the overall theme of Linux has always been to have a program do one specific thing, and do it well, many software titles utilize other pieces of software to run correctly.

Introduction

Let’s review what dependencies are and why they are required. We all have, at one point or another, most certainly seen a message from our system when we were installing software regarding “missing dependencies.” This error denotes that a required part of the software package is outdated, unavailable or missing. Let’s review how to address those issues when we come across them on Ubuntu.

Continue reading “How to Install and Correct Dependencies Issues in Ubuntu”

How to Install PHP Extensions on CentOS 8

Reading Time: 3 minutes

This tutorial covers the installation of the PHP extension phpredis via the default CentOS 8 package manager DNF. It will also cover the installation of both PHP 7.4 and Redis on CentOS 8.

PECL, the PHP Extension Community Library, is a repository of C extensions that are loaded directly into PHP. PHP Extensions expand the functionality of PHP. PECL extensions can be installed via the use of the pecl command. There are also PHP extensions provided by package repositories. The decision of which to utilize typically depends on how PHP was installed.

Continue reading “How to Install PHP Extensions on CentOS 8”

How to Add or Remove a PPA in Ubuntu 18.04

Reading Time: 5 minutes

What is a PPA?

A PPA (or Personal Package Archive) is a software repository provided by members of the Ubuntu Linux community. Software contained in a PPA can be downloaded and installed via apt, Ubuntu’s default package management system.

Typically, PPA’s will contain new or updated software to existing packages that may not be available from the official Ubuntu package repositories. This allows users to have more granular control over when specific software packages are updated on their systems. It is important to be discerning when utilizing PPA’s and to only add a PPA from a trusted source.

The best reason for adding software via a PPA, is the server will get automatic updates to the installed software when updates are run.

Continue reading “How to Add or Remove a PPA in Ubuntu 18.04”