No history yet

Introduction to GitHub

What is GitHub?

Think of a group project where everyone is editing the same document. Without a system, things can get messy fast. Someone might accidentally delete important work, or two people might overwrite each other's changes. It's chaos.

GitHub solves this problem for software developers. It's a web-based platform that uses a version control system called Git. In simple terms, it's a central place for developers to store their code, track every single change, and collaborate with others effectively. You can think of it like a highly organized, supercharged Google Docs for code.

GitHub isn't just a storage locker for code; it's a social network and project management hub for developers around the world. It’s where much of the open-source software that powers the internet is built.

Lesson image

The Heart of GitHub Repositories

The fundamental building block of GitHub is the repository, often shortened to "repo." A repository contains all of your project's files and, crucially, the entire history of every change made to those files. It's like a project folder that not only holds your current work but also remembers every previous version.

repository

noun

A central location where all the files for a particular project are stored and managed. It tracks the complete history of all changes to the files.

When you visit a repository on GitHub, you'll see the code files, a description of the project (usually in a file called README.md), and tools for collaboration. This structure provides a complete, self-contained home for a project.

Tracking Changes

Version control is about managing changes over time. GitHub does this using two key concepts: commits and branches.

commit

noun

A snapshot of your repository's files at a specific point in time. Each commit has a unique ID and a message describing the changes made.

Think of a commit as a permanent save point. When you've made a meaningful change—like adding a new feature or fixing a bug—you create a commit. Each commit is accompanied by a message explaining what you changed and why. This creates a historical log that tells the story of your project's development.

A good commit history reads like a clear, step-by-step summary of the project's journey. This is why clear commit messages are so important for teamwork.

But what if you want to work on a new idea without disrupting the stable, working version of your project? That's where branches come in.

A branch is essentially a parallel version of your repository. The main branch (often called main) holds the official, production-ready code. When you want to experiment or develop a new feature, you create a new branch. This gives you an isolated environment to make changes without affecting the main codebase. Once your work is complete and tested, you can merge your branch back into the main branch, integrating your new feature.

This branching model is the foundation of collaborative development on GitHub. It allows teams of developers to work on different parts of a project simultaneously without stepping on each other's toes. By keeping a clean history and using branches for new work, teams can build complex software in an organized and efficient way.

Quiz Questions 1/5

What is the primary purpose of GitHub?

Quiz Questions 2/5

In the context of GitHub, what is a "repository"?