What is GitHub and GitHub Actions

GitHub is a code hosting platform for collaboration and versions control. It also lets you work on projects together.

At a high level, GitHub is a website and cloud-based service that helps developers store and manage their code, as well as track and control changes to their code. To understand exactly what GitHub is, you need to know two connected principles:

Version control Git

What is Version Control

Version control helps developers track and manage changes to a software project’s code.

Instead, version control lets developers safely work through branching and merging.

With branching, a developer duplicates part of the source code (called the repository). The developer can then safely make changes to that part of the code without affecting the rest of the project.

Then, once the developer gets his or her part of the code working properly, he or she can merge that code back into the main source code to make it official.

GitHub has 5 core concepts.

  • Repositories

  • Branches

  • Commits

  • Pull Requests

  • Git (the version control software GitHub is build upon)

Repository

A GitHub repository can be used to store a development project.

It can contain folders and any type of files (HTML, CSS, JavaScript, Documents, Data, Images).

A GitHub repository should also include a license file and a README file about the project.

A GitHub repository can also be used to store ideas, or any resources that you want to share.

Branch

A GitHub branch is used to work with different versions of a repository at the same time.

By default a repository has a main branch (a production branch).

Any other branch is a copy of the main branch (as it was at a point in time).

New Branches are for bug fixes and feature work separate from the main branch. When changes are ready, they can be merged into the main branch. If you make changes to the main branch while working on a new branch, these updates can be pulled in.

Commits

At GitHub, changes are called commits.

Each commit (change) has a description explaining why a change was made.

Pull Requests

Pull Requests are the heart of GitHub collaboration.

With a pull request you are proposing that your changes should be merged (pulled in) with main.

Pull requests show content differences, changes, additions, and subtractions in colors (green and red).

As soon as you have a commit, you can open a pull request and start a discussion, even before the code is finished.

References

W3Schools - What is GitHub