GitHub is a web-based platform that hosts Git repositories in the cloud and provides powerful collaboration tools for developers. Think of it as a social network for code—where developers can share projects, collaborate on software, review each other's code, and contribute to open-source projects. With over 100 million developers and 400 million repositories, GitHub has become the world's largest platform for software development and collaboration.
Git vs. GitHub: Understanding the Difference
In the previous lesson, we learned about Git. Now let's clarify the relationship between Git and GitHub, because this confusion trips up almost every beginner:
Git
- Version control software that runs on your computer
- Created by Linus Torvalds in 2005
- Works completely offline
- Free and open source
- Tracks changes to your files locally
- Command-line tool (though GUIs exist)
GitHub
- Web platform for hosting Git repositories online
- Founded in 2008, owned by Microsoft since 2018
- Requires internet connection
- Free for public repos, paid plans for private/advanced features
- Stores your repositories in the cloud
- Web-based interface with additional collaboration features
🔗 They Work Together
Git is the tool that does version control on your computer. GitHub is where you can store those Git repositories online to share with others. You use Git commands to push your code to GitHub, and pull code from GitHub to your computer.
The Relationship in Simple Terms
Here are some analogies that might help:
- Git is like Microsoft Word; GitHub is like Google Drive (a place to store and share your documents)
- Git is like your local photo library; GitHub is like Instagram (a place to share and discover photos)
- Git is like your email client (Outlook, Apple Mail); GitHub is like Gmail (a service that hosts your emails)
Just as you can use Word without Google Drive, or take photos without Instagram, you can use Git without GitHub. But they're better together!
What GitHub Actually Does
GitHub takes Git repositories and makes them available on the internet. But it does much more than just store your code:
1. Remote Repository Hosting
GitHub stores your Git repositories in the cloud, making them accessible from anywhere. This serves as:
- A backup: Your code is safe even if your laptop breaks
- A collaboration hub: Team members can access the same repository
- A deployment source: Many hosting services deploy directly from GitHub
2. Collaboration Features
GitHub adds powerful tools on top of Git that make working with others easier:
Pull Requests
A pull request (PR) is a way to propose changes to a project. It allows:
- Team members to review your code before it's merged
- Discussion about the changes through comments
- Automated tests to run on your code
- Tracking of all conversations and decisions
Issues
Issues are GitHub's built-in bug tracking and task management system:
- Report bugs or request features
- Assign tasks to team members
- Label and organize work
- Link issues to specific code changes
Code Review
GitHub provides tools for thorough code review:
- Line-by-line commenting on code changes
- Suggest specific code improvements
- Approve or request changes to pull requests
- Track review status and required approvals
3. Social Coding Features
GitHub is often called "the social network for developers" because it includes:
- Following: Follow developers and see their activity
- Starring: Bookmark repositories you find interesting
- Forking: Make your own copy of someone's project to experiment with
- Contributions: Your contribution graph shows your coding activity
- Profiles: Showcase your projects and contributions
4. Project Management Tools
GitHub includes features to help manage software projects:
- Projects: Kanban-style boards to organize work
- Milestones: Group issues and track progress toward goals
- Wiki: Documentation pages for your project
- Discussions: Community forums for your project
5. Automation and CI/CD
GitHub Actions allows you to automate workflows:
- Run tests automatically when code is pushed
- Deploy your application when changes are merged
- Check code quality and formatting
- Automate repetitive tasks
Understanding Local vs. Remote Repositories
One of the most important concepts to understand is the difference between local and remote repositories:
Local Repository
Your local repository is the Git repository on your own computer. It contains:
- All your project files
- The complete Git history
- All branches
- Your uncommitted changes
You work here, make changes, create commits, and switch between branches.
Remote Repository
A remote repository is a Git repository hosted on a server (like GitHub). It contains:
- A copy of the project files
- The Git history (commits)
- Branches that have been pushed
This is where you share your work with others and where others share their work with you.
How They Work Together
Here's the typical workflow:
- Clone: Copy a remote repository from GitHub to your computer
- Work locally: Make changes, create commits on your computer
- Push: Send your commits from your local repository to GitHub
- Pull: Get commits that others have pushed to GitHub
# Clone a repository from GitHub to your computer
git clone https://github.com/username/project.git
# Make changes to files, then stage and commit
git add .
git commit -m "Add new feature"
# Push your commits to GitHub
git push origin main
# Get the latest changes from GitHub
git pull origin main🔄 The Sync Cycle
Think of it as a constant sync cycle: you work locally (fast and offline), then push your changes to GitHub (to share and backup). Your teammates do the same, and you pull their changes to stay up-to-date.
Key GitHub Features Explained
Repositories (Repos)
A repository is a project on GitHub. It contains all of your project's files and the entire version history. Repositories can be:
- Public: Anyone can see the code (great for open source)
- Private: Only you and collaborators you invite can see it
README Files
The README.md file is the front page of your repository. It typically contains:
- Project description and purpose
- Installation instructions
- Usage examples
- Contribution guidelines
- License information
The .md extension means it's written in Markdown, a simple formatting language that GitHub renders beautifully.
Branches on GitHub
Just like in Git, GitHub shows all your branches. The default branch is usually called main (formerly master). You can:
- Create branches directly on GitHub's web interface
- See all branches and their last update time
- Compare differences between branches
- Set branch protection rules (require reviews, tests, etc.)
Commits on GitHub
GitHub provides a beautiful interface to browse commits:
- See the full commit history with a visual graph
- View exactly what changed in each commit
- See who made each change and when
- Link commits to issues and pull requests
Forks
A fork is your own personal copy of someone else's repository:
- You can experiment without affecting the original project
- Perfect for contributing to open source (fork, make changes, submit pull request)
- Forks maintain a connection to the original repository
- You can sync your fork with updates from the original
GitHub Pages
GitHub Pages lets you host static websites directly from a GitHub repository—for free! This is perfect for:
- Personal portfolios
- Project documentation
- Blog sites
- Landing pages
Why GitHub Matters
1. Industry Standard
GitHub is used by virtually every major tech company and millions of developers worldwide. Having a GitHub profile with your projects is like having a living resume that shows your actual work.
2. Open Source Community
GitHub hosts the vast majority of open-source projects. Want to contribute to React, Vue, TensorFlow, or VS Code? They're all on GitHub. You can:
- Learn from high-quality codebases
- Contribute to projects used by millions
- Build your reputation in the developer community
- Network with other developers
3. Portfolio and Job Opportunities
Many employers look at GitHub profiles during hiring. Your GitHub account shows:
- Your coding skills through your projects
- Your consistency (contribution graph)
- Your collaboration abilities (pull requests, issues)
- Your communication skills (documentation, code comments)
4. Learning Resource
GitHub is an incredible learning platform:
- Read code from experienced developers
- See how real-world projects are structured
- Follow along with issue discussions and architectural decisions
- Fork projects to experiment and learn
💼 Career Advantage
According to surveys, over 70% of developers say GitHub is important for their career. Having an active GitHub profile with quality projects can significantly improve your job prospects.
GitHub Alternatives
While GitHub is the most popular, there are other platforms that also host Git repositories:
GitLab
- Similar features to GitHub
- Strong focus on DevOps and CI/CD
- Can be self-hosted
- Generous free tier for private repositories
Bitbucket
- Owned by Atlassian (makers of Jira, Confluence)
- Integrates well with other Atlassian products
- Popular in enterprise environments
- Free unlimited private repositories for small teams
Other Options
- SourceForge: One of the oldest code hosting platforms
- Gitea: Lightweight, self-hosted Git service
- Codeberg: Non-profit, privacy-focused alternative
That said, GitHub's network effects (where everyone else is) make it the default choice for most developers, especially for open source work.
GitHub Pricing and Plans
GitHub offers several pricing tiers:
Free Plan
The free plan includes:
- Unlimited public repositories
- Unlimited private repositories
- Up to 2,000 CI/CD minutes per month
- 500MB of package storage
- Community support
Good news: The free plan is more than enough for beginners, students, and even many professional developers. You can host unlimited public and private projects for free!
Paid Plans
GitHub offers paid plans for teams and enterprises with:
- More CI/CD minutes and storage
- Advanced security features
- Protected branches and code owners
- Priority support
- Advanced collaboration tools
🎓 Students and Teachers
GitHub offers free Pro accounts to students and teachers through the GitHub Education program. This includes access to GitHub Copilot and other premium features!
Getting Started with GitHub
To start using GitHub, you'll need to create a free account. Here's what happens next:
- Create an account at github.com
- Choose a username (this will be part of your profile URL)
- Verify your email to access all features
- Set up your profile with a bio and profile picture
- Create your first repository or explore existing projects
In the upcoming lessons, we'll walk through installing Git, configuring it, and connecting it to your GitHub account so you can push and pull code seamlessly.
✨ Username Tip
Choose your GitHub username carefully! It becomes part of your profile URL (github.com/yourusername) and appears on all your contributions. Pick something professional that you'll be happy with long-term. Your username can be changed later, but it can break links to your repositories.
Preview: The Complete Git + GitHub Workflow
Here's a preview of how you'll use Git and GitHub together (don't worry if some commands are unfamiliar—we'll cover everything in detail):
# 1. Clone a repository from GitHub
git clone https://github.com/username/my-project.git
cd my-project
# 2. Create a new branch for your feature
git checkout -b feature/add-login
# 3. Make changes to files
# ... edit your code ...
# 4. Stage and commit your changes
git add .
git commit -m "Add user login functionality"
# 5. Push your branch to GitHub
git push origin feature/add-login
# 6. Open a Pull Request on GitHub (via web interface)
# 7. Team reviews your code
# 8. After approval, merge into main branch
# 9. Pull the updated main branch
git checkout main
git pull origin mainThis workflow—branching, committing, pushing, pull requests—is how professional teams collaborate on software. We'll break down each step in the coming lessons.
Common GitHub Terms You'll See
GitHub has its own vocabulary. Here are terms you'll encounter frequently:
- Repo/Repository: A project on GitHub
- Fork: Your personal copy of someone else's repository
- Clone: Download a repository to your computer
- Push: Send your commits to GitHub
- Pull: Get the latest changes from GitHub
- PR (Pull Request): Propose changes to a project
- Merge: Combine branches together
- Issue: A bug report, feature request, or task
- Star: Bookmark a repository you like
- Watch: Subscribe to notifications for a repository
- Contributor: Someone who has contributed code to a project
- Maintainer: Person responsible for managing a project
GitHub Best Practices
Even as a beginner, start with these good habits:
1. Write Good README Files
Every repository should have a clear README that explains:
- What the project does
- How to install and use it
- How others can contribute
2. Use Descriptive Repository Names
Choose clear, descriptive names like recipe-sharing-app instead of project1 or stuff.
3. Keep Your Profile Updated
Add a profile picture, bio, and pin your best repositories.
4. Make Meaningful Commits
Write clear commit messages that explain what changed and why (we'll cover this in detail later).
5. Be Respectful in Discussions
When commenting on issues or pull requests, be constructive, helpful, and professional.
6. Contribute to Others' Projects
Even small contributions (fixing typos, improving documentation) help you learn and build your reputation.
Key Takeaways
- GitHub is a web platform that hosts Git repositories in the cloud
- Git works on your computer; GitHub stores repositories online
- You can use Git without GitHub, but they work great together
- GitHub adds collaboration features: pull requests, issues, code review
- Local repositories are on your computer; remote repositories are on GitHub
- GitHub is essential for open source, collaboration, and showcasing your work
- The free plan includes unlimited public and private repositories
- Your GitHub profile serves as a portfolio for potential employers
- GitHub has alternatives (GitLab, Bitbucket) but is the most popular
What's Next?
Now that you understand what GitHub is and how it relates to Git, you're ready to start using both!
In the next lesson, we'll install Git on your computer, configure it properly, and connect it to your GitHub account. This will set you up to start creating repositories and tracking your code changes.
🎯 Action Items
Before the next lesson, go ahead and:
- Create a free GitHub account at github.com
- Choose a professional username
- Verify your email address
- Add a profile picture and short bio
- Explore some popular repositories (search for "awesome lists" or projects you're interested in)
Having your GitHub account ready will let you follow along when we start connecting Git to GitHub!