What is GitHub?
GitHub is a cloud-based platform for hosting Git repositories and collaborating with other developers. It takes everything Git does locally — tracking changes, managing branches, merging code — and adds a web interface with tools for code review, issue tracking, automation and project management.
Think of Git as the engine and GitHub as the dashboard. Git runs on your machine, handling version control. GitHub hosts your repository online, letting others see your code, suggest improvements, report bugs and contribute features through a structured workflow.
With over 100 million developers and 330 million repositories, GitHub is where the world builds software. Open source projects, startups, enterprises and individual developers all use it as their primary collaboration platform. If you are learning to code, having a GitHub profile is as important as having a portfolio.
Why GitHub matters
Version control on your machine is useful, but collaboration requires a shared space. GitHub provides that space with features that make teamwork structured and transparent:
- Centralized hosting — your code lives in the cloud, accessible from anywhere with a backup that never gets lost.
- Pull requests — propose changes, review code line by line and merge only when everyone agrees.
- Issues and project boards — track bugs, manage features and organize work with labels, milestones and kanban boards.
- CI/CD automation — GitHub Actions runs tests, builds and deploys your code automatically on every push.
- Community — discover open source projects, contribute to them and build your developer reputation.
- Security — dependency scanning, secret detection and code review workflows catch vulnerabilities early.
GitHub is not just a code hosting service. It is a development platform that covers the entire software lifecycle from idea to deployment.
Setting up GitHub
Creating an account
Go to github.com and sign up with your email. Choose the free plan — it includes everything you need to get started.
Configuring Git
After creating your account, configure Git to work with GitHub:
# Set your identity
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
# Set the default branch name
git config --global init.defaultBranch main
Connecting via SSH
SSH keys let you authenticate without entering your password every time:
# Generate a new SSH key
ssh-keygen -t ed25519 -C "[email protected]"
# Start the SSH agent
eval "$(ssh-agent -s)"
# Add your key to the agent
ssh-add ~/.ssh/id_ed25519
# Copy the public key to add to GitHub
cat ~/.ssh/id_ed25519.pub
Go to GitHub Settings > SSH and GPG keys > New SSH key, paste your public key and save. You can now clone, push and pull using SSH URLs.
Core GitHub features
Repositories
A repository is a project on GitHub. It contains your code, configuration files, documentation and the complete Git history. Every repository has:
- A code tab for browsing files
- An issues tab for tracking work
- A pull requests tab for code review
- A wiki for documentation
- A settings tab for access control
Create a new repository from the GitHub homepage or from the command line:
# Create a new repo on GitHub, then clone it
gh repo create my-project --public --clone
Issues
Issues are how you track work. Use them for bug reports, feature requests, tasks and discussions:
# Create an issue from the command line
gh issue create --title "Fix login bug" --body "Users cannot log in with empty email"
Each issue can have:
- Labels — categorize by type (bug, enhancement, documentation)
- Assignees — who is responsible
- Milestones — group issues into releases or sprints
- Linked pull requests — show which PRs close the issue
Pull requests
Pull requests are the heart of GitHub collaboration. They let you propose changes, review code and merge when ready:
# Create a branch, make changes, push, then open a PR
git checkout -b fix-login-bug
# make changes
git add .
git commit -m "Fix null check in login handler"
git push origin fix-login-bug
gh pr create --title "Fix login bug" --body "Adds null check for empty email"
Pull requests include code review tools, automated checks, discussion threads and merge controls. They are the standard way to get code into a shared codebase.
GitHub Actions
Actions automate your development workflow. Write YAML files that define what happens when events occur:
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
Common uses include running tests on every push, deploying to production on merge to main and building Docker images on release.
GitHub Pages
Host static websites directly from your repository:
# Enable Pages in your repo settings, then push to the gh-pages branch
git checkout -b gh-pages
git push origin gh-pages
Pages is perfect for documentation sites, portfolios, blogs and landing pages. It supports custom domains, HTTPS and static site generators like Jekyll and Astro.
Working with teams
Forking repositories
Forking creates your own copy of someone else’s repository. You can make changes without affecting the original:
# Fork a repo using the GitHub CLI
gh repo fork owner/repo --clone
# Or fork and add a remote
git remote add fork https://github.com/your-username/repo.git
Forking is the standard way to contribute to open source. You fork the repository, make changes in your fork and open a pull request back to the original.
Code review
GitHub’s code review tools let you comment on specific lines, suggest changes and request modifications:
- Inline comments — discuss specific lines of code
- Suggested changes — propose edits that authors can accept with one click
- Review approvals — approve, request changes or comment on the overall PR
- Code owners — automatically assign reviewers based on which files changed
Branch protection
Protect important branches from accidental or unauthorized changes:
- Require pull request reviews before merging
- Require status checks to pass (CI must be green)
- Require linear history (no merge commits)
- Restrict who can push to the branch
- Require signed commits
Project management
GitHub Projects provides kanban boards, tables and roadmaps for managing work:
- Create columns like “To Do”, “In Progress” and “Done”
- Link issues and pull requests to cards
- Automate card movement based on events
- Track progress with insights and charts
Best practices
- Write descriptive README files — explain what your project does, how to install it and how to contribute.
- Use issue templates — standardize bug reports and feature requests.
- Enable branch protection — require reviews and passing CI before merging.
- Write meaningful PR descriptions — explain what changed, why and how to test it.
- Use GitHub Actions — automate testing and deployment instead of doing it manually.
- Keep repositories focused — one project per repo, not a monolith of unrelated code.
- Tag releases — use semantic versioning and GitHub Releases to mark stable versions.
- Contribute to open source — fork, fix, and submit pull requests to build experience and reputation.
Common mistakes
- Pushing sensitive data like API keys or passwords to a public repository.
- Not writing a README, leaving visitors confused about what the project does.
- Creating pull requests with no description or context for reviewers.
- Ignoring issues and letting them pile up without triage.
- Not using branch protection, allowing direct pushes to main.
- Committing node_modules, .env or other files that should be in .gitignore.
- Using GitHub as a backup service without understanding Git locally first.
What to learn next
You now understand GitHub’s core features: repositories, issues, pull requests and Actions. From here the natural next step is Git for mastering the version control system underneath, including branching, merging and rebasing. Pick a project, contribute to it and let the practice compound.