What is GitHub?
GitHub is a web-based platform for hosting Git repositories. It's the world's largest code hosting platform with over 100 million developers.
Git vs GitHub
| Git | GitHub |
|---|---|
| Version control system | Hosting platform |
| Installed on your computer | Accessed via web |
| Command-line tool | Web interface + API |
| Created by Linus Torvalds | Created by Tom Preston-Werner |
| Free and open source | Freemium service |
Key Point: Git is the tool, GitHub is a service that hosts Git repositories.
GitHub Features
1. Repository Hosting
Store your code in the cloud:
github.com/username/repository-name
2. Pull Requests
Propose changes and review code:
1. Create branch
2. Make changes
3. Open Pull Request
4. Review & discuss
5. Merge
3. Issues
Track bugs, features, and tasks:
Issue #42: Fix login bug
- Assigned to: @developer
- Labels: bug, high-priority
- Milestone: v1.0.0
4. Actions (CI/CD)
Automate workflows:
1# .github/workflows/test.yml
2on: push
3jobs:
4 test:
5 runs-on: ubuntu-latest
6 steps:
7 - uses: actions/checkout@v2
8 - run: npm test5. Pages
Host websites for free:
username.github.io/repository
6. Discussions
Community Q&A and conversations.
7. Projects
Kanban-style project management.
GitHub Account Types
| Type | Features |
|---|---|
| Free | Unlimited public/private repos, 2000 Actions minutes/month |
| Pro | Advanced features, more Actions minutes |
| Team | Organization features, team management |
| Enterprise | Advanced security, compliance |
Creating a GitHub Account
- Go to github.com
- Click "Sign up"
- Enter email, password, username
- Verify your email
- Complete the setup wizard
GitHub Terminology
Repository (Repo)
A project container with code, issues, and settings.
Fork
A copy of someone else's repository in your account.
Star
Bookmark a repository you like.
Watch
Get notifications for repository activity.
Clone
Download a repository to your computer.
Fork vs Clone
Fork: Copy on GitHub (your account)
Clone: Copy on your computer
Your GitHub Profile
Your profile shows:
- Repositories: Your projects
- Contributions: Your activity graph
- Followers/Following: Your network
- Bio: About you
- README: Custom profile page
Profile README
Create a repository named username/username with a README.md for a custom profile.
GitHub URLs
# User profile
github.com/username
# Repository
github.com/username/repository
# Specific file
github.com/username/repository/blob/main/file.js
# Specific line
github.com/username/repository/blob/main/file.js#L42
# Pull request
github.com/username/repository/pull/123
# Issue
github.com/username/repository/issues/456
GitHub for Open Source
Contributing to Projects
- Find a project you want to contribute to
- Fork the repository
- Clone your fork
- Create a branch for your changes
- Make changes and commit
- Push to your fork
- Open a Pull Request to the original repo
Popular Open Source on GitHub
- Linux
- React
- VS Code
- Kubernetes
- TensorFlow
GitHub CLI
Install the GitHub CLI for terminal access:
1# Install (Mac)
2brew install gh
3
4# Login
5gh auth login
6
7# Create repo
8gh repo create my-project
9
10# Create issue
11gh issue create
12
13# Create PR
14gh pr createSummary
GitHub provides:
- ✅ Free repository hosting
- ✅ Collaboration features (PRs, Issues)
- ✅ CI/CD with Actions
- ✅ Project management tools
- ✅ Community features
- ✅ Free website hosting
Next, let's create your first remote repository!
