GitHub is the world's leading platform for code collaboration. Whether you're a developer, writer, or total beginner — this guide walks you through everything step by step.
GitHub is a web platform built on Git, the open-source version control system. Think of it as Google Docs, but for code.
Every change is tracked. Roll back to any previous version of your project at any time.
Multiple people can work on the same project simultaneously without overwriting each other.
Teammates can comment on, suggest, and approve changes before they're merged.
Over 100 million developers share and contribute to public projects worldwide.
GitHub Actions lets you automatically test, build, and deploy your code on every push.
GitHub was created by Chris Wanstrath, P.J. Hyett, Tom Preston-Werner, and Scott Chacon using Ruby on Rails. It launched in February 2008 and was acquired by Microsoft in 2018 for $7.5 billion.
Git is the version control software that runs on your computer. GitHub is a cloud platform that hosts your Git repositories online, making them shareable and collaborative.
Writers, designers, scientists, and students all use GitHub to manage documents, research, design files, and collaborative projects.
From solo projects to large enterprise teams, GitHub solves real problems that every collaborator faces.
Every version of your project is saved in the cloud. Accidentally deleted something? GitHub has it. Hard drive crashed? GitHub has it.
Teams can work on different features simultaneously using branches. Changes are merged when ready, eliminating duplicate work.
Issues, milestones, and project boards let you track bugs, plan features, and organize work — all in one place.
GitHub Actions automatically tests your code on every commit. Ship with confidence knowing nothing is broken.
Access millions of open-source projects. Learn from real codebases, report bugs, and contribute back to the community.
Automated vulnerability scanning, secret detection, and code review workflows keep your project secure by default.
It only takes a few minutes. Follow these steps to get up and running.
Open your browser and navigate to github.com. You'll see a big green "Sign Up" button on the homepage. Click it.
GitHub will send a verification email. Open it and click the confirmation link. Check your spam folder if you don't see it within a minute.
GitHub will ask a few questions about your role (student, developer, etc.) and what you plan to use it for. Answer honestly — it helps personalize your experience.
A repository (or "repo") is like a folder for your project. Click the green "New" button on your dashboard, give it a name, optionally add a README file, and click "Create repository".
To work with GitHub locally, download Git from git-scm.com. You can also use GitHub Desktop for a visual interface, or work entirely in the browser for simple edits.
These are the fundamental ideas behind GitHub. Learn these and everything else will click.
A repository is a folder that contains all your project files, their history, and metadata. Every project lives in its own repo.
A commit is a snapshot of your project at a specific moment. Each commit has a message explaining what changed and why.
A branch is an isolated copy of your project where you can experiment or build features without affecting the main codebase.
A Pull Request (PR) is how you propose changes to a repo. Teammates can review, comment, and approve before the code is merged.
Forking creates your personal copy of someone else's repository. You can experiment freely, then propose changes back via a Pull Request.
Push uploads your local commits to GitHub. Pull downloads the latest changes from GitHub to your machine.
Most teams follow this cycle. Once you've done it a few times, it becomes second nature.
Get the project onto your machine
Create a branch for your feature
Make your changes locally
Save snapshots as you go
Upload your branch to GitHub
Request a review and merge
Small habits that make a huge difference in your day-to-day workflow.
Use the format: "Add user login feature" or "Fix broken navbar on mobile". Future-you will thank present-you.
Don't wait until a feature is finished. Commit small, working chunks. It's easier to track down bugs and easier to roll back.
Never commit directly to main. Branches are free and keep your history clean.
Every project should have a README.md explaining what it does, how to install it, and how to use it. It's the first thing visitors see.
API keys, passwords, and tokens must never go into a repo. Use .env files and add them to .gitignore.
Always run git pull before pushing to avoid merge conflicts with your teammates' work.
Bookmark this page. These are the commands you'll use every single day.
| git init | Initialize a new local repository |
| git clone [url] | Clone a remote repository locally |
| git config --global user.name | Set your global username |
| git config --global user.email | Set your global email |
| git status | Show the state of your working directory |
| git add . | Stage all changes for commit |
| git add [file] | Stage a specific file |
| git commit -m "msg" | Commit with a message |
| git log --oneline | View compact commit history |
| git branch | List all local branches |
| git branch [name] | Create a new branch |
| git checkout [name] | Switch to a branch |
| git checkout -b [name] | Create and switch in one step |
| git merge [branch] | Merge a branch into current |
| git branch -d [name] | Delete a branch |
| git remote -v | List remote connections |
| git fetch | Download changes without merging |
| git pull origin main | Pull latest changes from main |
| git push origin [branch] | Push a branch to GitHub |
| git push -u origin main | Push and set upstream tracking |
| git restore [file] | Discard changes in working directory |
| git reset HEAD [file] | Unstage a file |
| git revert [commit] | Undo a commit by creating a new one |
| git stash | Temporarily shelve your changes |
| git stash pop | Restore stashed changes |
| git diff | Show unstaged changes |
| git diff --staged | Show staged changes |
| git log --graph | Visual branch history |
| git show [commit] | Show details of a commit |
| git blame [file] | Show who changed each line |