What is GitHub?

Balu Ilag | August 24th 2022

What is GitHub?

What is GitHub?

GitHub is a code (source code, script, snapshot) hosting platform for version control and collaboration. It allows developers to work together from any place. GitHub is a development platform that enables developers or users to host and review code, manage projects, and build software alongside numerous developers.  In addition to providing a platform for collaborative software development, GitHub gives a workflow intended to enhance the usage of its many features.

In nutshell, GitHub is a cloud-hosted platform that uses Git as its core skill. It simplifies the project collaboration process and provides a website, command-line tools, and overall flow that allows developers and users to work together. This blog post covers information about what GitHub is, Git and GitHub differences, and GitHub’s capabilities and features.

Why is GitHub so popular?

GitHub is generally used for securely hosting code on a cloud platform. It provides significant DevOps features to corporations and organizations of all sizes that require their public and private projects. Whether GitHub’s planning features, solving bugs or collaborating on changes, GitHub is the place where the world’s software developers gather to make things and then make them more useful.

What is the fundamental difference between Git and GitHub?

Git is a distributed version control (DVCS) system that allows multiple developers or other contributors to work on a project. It offers a way to work with one or more local branches and push them to a remote repository. Git is accountable for everything GitHub-related that happens locally on the developer’s computer. The main features provided by Git include Git, installed and used on your local machine; it handles version control and supports branching.

Whereas GitHub is a cloud platform that uses Git as its core technology. It streamlines the process of collaborating on projects and offers a website, command-line tools, and overall flow that allows developers and users to work together. GitHub acts as the “remote repository.” The main features provided by GitHub are, Issues, Discussions, Pull requests, Notifications, Labels, Actions, Forks, and Projects.

GitHub’s main features:

There are multiple features that GitHub providers and are useful for software development.

Starting with Issues: Issues are in which the majority of the communication happens between a project’s customers and the development team. Basically, an issue can be created to discuss a broad set of subjects, such as bug reports, feature requests, documentation clarifications, and many more. Once an issue has been created, it can be assigned to owners, labels, projects, and milestones. Users can also associate issues with pull requests and other GitHub items to provide future traceability. For instance, I have the repo “GitHubBookContent,” and figure 1 shows the new issue created for content update.

Figure 1, Submit New issue

GitHub Notification:

GitHub offers notifications features for virtually every event that takes place within a given workflow. Notification is a very important feature specifically for GitHub as a collaborative platform. These notifications can be adjusted and customized based on user preferences. For instance, you can subscribe to all issue creations and edits on a project, or you can just receive notifications for issues in which you are mentioned. You can also decide whether you receive notifications via email, web & mobile, or both.  Figure 2 shows the simple email notification setup.

Figure 2, Email notification.

GitHub Branches:

Branches are the preferred way to create changes in the GitHub flow. They provide isolation so that multiple people may simultaneously work on the same code in a controlled way. This design enables stability among critical branches, such as the main, while allowing complete freedom for developers to commit any changes they need to meet their goals. Once the code from a branch is ready to become part of the main branch, it may be merged via pull request.

Commits:

In GitHub, a commit is a change to one or more files on a branch. Each time a commit is created, it’s assigned a unique ID and tracked, along with the time and contributor. This provides a clear audit trail for anyone reviewing the history of a file or linked item, such as an issue or pulls request.

Pull Requests:

Pull request is another important feature GitHub provides. It is the way used to signal that the commits from one branch are ready to be merged into another branch. The developer or users submitting the pull request will often request one or more reviewers to verify the code and approve the merge. These reviewers have the opportunity to comment on changes, add their own, or use the pull request itself for further discussion. Once the changes have been approved (if approval is required), the pull request’s source branch (the compare branch) may be merged into the base branch.

Pull requests allow developers/users to tell others about changes they have pushed to a branch in a repository on GitHub. Once a pull request is opened, a developer can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

Labels:

Labels offer a way to categorize and organize issues and pull requests in a repository. As the developer/user creates a GitHub repository, several labels will automatically be added for them, and new ones can also be created. Labels that are commonly used include bug, documentation, duplicate, enhancement, help wanted, invalid, question, etc. Figure 3 shows the list of labels.

Figure 3, List of labels.

GitHub Actions for the automation

GitHub actions offer task automation and workflow functionality in a repository.  GitHub Actions can be used to streamline processes in the software development lifecycle and implement continuous integration and continuous deployment (CI/CD). GitHub Actions are constructed using the below components; these are the main components of GitHub Actions.

  • Workflows: Automated processes added to your repository.
  • Events: An activity that triggers a workflow.
  • Jobs: A set of steps that execute on a runner.
  • Steps: A task that can run one or more commands (actions).
  • Actions: Standalone commands that can be combined into steps. Multiple steps can be combined to create a job.
  • Runners: Server that has the GitHub Actions runner application installed.

For instance, event push occurs – the check bats version

  • Step1 – check the repository
  • Step2 – install node
  • Step3 – install bats
  • Step4 – Run bats

Repo Cloning and forking

GitHub provides multiple ways to copy a repository so that developers or users can work on it locally. The most useful ways to work on a repository are cloning and forking the repository.

  • Cloning a Repository– Cloning a repository will make a copy of the repository and its history on the local machine. If developers or users have to write access to the repository, they can push changes from their local machine to the remote repository (called the origin) as they are completed. To clone a repository, you can use the git clone command or the GitHub CLI’s gh repo clone
  • Forking a Repository– Forking a repository makes a copy of the repository in your GitHub account. The parent repository is referred to as the upstream, while your forked copy is referred to as the origin. Once you’ve forked a repository into your GitHub account, you can clone it to your local machine. Forking allows you to freely make changes to a project without affecting the original upstream To contribute changes back to the upstream repository, you create a pull request from your forked repository. You can also run git commands to ensure that your local copy stays synced with the upstream repository.

Since both cloning and forking will make a copy of the repository, when would the developer/user clone a repository versus fork a repository? Users can clone it to their local machine if they work with a repository and have write access. From there, they can make modifications and push their changes directly to the origin repository.

GitHub Pages

GitHub Pages is a hosting engine that’s made available in the GitHub account. Users can build their own static site created from HTML and markdown code pulled directly from users’ repositories.

End.

No Comments

Sorry, the comment form is closed at this time.