Introduction to GitHub

GitHub is a web-based platform that hosts Git repositories on the internet. While Git is the tool that tracks changes on a local computer, GitHub provides a place to store those repositories online so they can be accessed from anywhere and shared with others.

Think of it this way: Git is like a diary that records everything. GitHub is like a cloud service where that diary is backed up and shared with collaborators.

GitHub was founded in 2008 and was acquired by Microsoft in 2018. It is the world's largest platform for hosting and collaborating on code, with over 100 million registered developers and billions of repositories.

Git vs GitHub — What is the Difference?

GitGitHub
A version control tool (software)A web platform that hosts Git repositories
Installed on a local computerAccessed via a web browser at github.com
Works completely offlineRequires an internet connection
Created by Linus Torvalds (2005)Founded in 2008, owned by Microsoft
No user accounts neededRequires creating a free account
Tracks changes locallyProvides collaboration tools, issue tracking, and more

Why Use GitHub?

GitHub adds many powerful features on top of Git that make team collaboration much easier:

  • Remote Backup — Code is stored safely on GitHub's servers, so if a computer crashes, the project is not lost
  • Collaboration — Multiple developers can work on the same project from anywhere in the world
  • Pull Requests — A formal way to review and discuss code changes before merging them into the main codebase
  • Issues — A built-in bug tracker and task management system for reporting problems or suggesting features
  • Actions — Automated workflows for testing, building, and deploying code (CI/CD)
  • GitHub Pages — Free hosting for static websites directly from a repository
  • Portfolio — A public profile that showcases projects and contributions to potential employers

Key GitHub Concepts

Repository (Repo)

A repository on GitHub is the online copy of a project. It contains all the files, commit history, branches, and issues. A repository can be public (visible to everyone) or private (visible only to invited collaborators).

Fork

Forking creates a personal copy of someone else's repository in the GitHub account. Changes can be made freely to the forked copy without affecting the original project. This is how open-source contributions work.

Pull Request (PR)

A Pull Request is a request to merge changes from one branch (or fork) into another. It provides a space for reviewing code, leaving comments, and discussing the changes before they are accepted into the main project.

Issue

An Issue is a note created on a repository to report a bug, request a feature, or ask a question. Issues are public and can be discussed by anyone with access to the repository.

Star

Starring a repository is like bookmarking it. Stars also serve as a popularity metric — a repository with many stars is considered well-known and widely used.

Watch

Watching a repository means receiving notifications about all activity in it — new commits, issues, pull requests, and comments.

Gist

A Gist is a simple way to share small snippets of code or text on GitHub without creating a full repository.

GitHub Profile and Portfolio

A GitHub profile page shows a developer's public repositories, contribution history (the famous "green squares" activity graph), and other information. Many recruiters and companies actively look at GitHub profiles when hiring developers.

The contribution graph shows how consistently someone contributes to code. Each green square represents a day where at least one commit, pull request, or review was made.

GitHub Alternatives

GitHub is not the only platform for hosting Git repositories. Other popular options include:

PlatformWebsiteNotable Feature
GitLabgitlab.comBuilt-in CI/CD, self-hosting option
Bitbucketbitbucket.orgTight Jira integration, Atlassian suite
Azure DevOpsdev.azure.comDeep Microsoft/Azure integration

How GitHub Fits Into the Git Workflow

Local Computer                     GitHub (Internet)
─────────────                     ─────────────────
1. git init         → Creates local repo
2. Edit files       → Make changes
3. git add          → Stage changes
4. git commit       → Save locally
5. git push         ──────────────────► Uploads to GitHub
6. git pull         ◄────────────────── Downloads from GitHub

Summary

GitHub is a cloud-based platform for hosting Git repositories. It adds collaboration features like pull requests, issues, and Actions on top of Git's version control capabilities. Git works locally; GitHub connects the project to the internet and to other developers. For any developer, having a GitHub account and keeping repositories there is an essential professional skill.

Leave a Comment

Your email address will not be published. Required fields are marked *