Git and GitHub work together but are not the same thing: Git is a version-control tool that tracks every change to your code on your machine, and GitHub is a website that hosts Git repositories so you can back them up and collaborate. To start in 2026 you need only a handful of commands: clone, add, commit, push, pull, and status. Commit small changes with clear messages, use branches to isolate work, and open pull requests to merge. Here is the workflow that covers almost every day.
Git versus GitHub
This trips up nearly every beginner. Git runs locally and records snapshots (commits) of your project so you can review history and undo changes. GitHub is one of several websites (alongside GitLab and Bitbucket) that store those repositories in the cloud and add collaboration features like pull requests and issues. You can use Git with no GitHub account; GitHub without Git makes little sense. For the deeper distinction, read Git versus GitHub explained, and for the tool itself, what Git is.
The commands you use most
| Command |
What it does |
| git clone |
Copy a remote repository to your machine |
| git status |
See what has changed and what is staged |
| git add |
Stage changes for the next commit |
| git commit -m "message" |
Save a snapshot with a description |
| git push |
Send your commits to GitHub |
| git pull |
Fetch and merge others changes from GitHub |
| git branch / git checkout -b |
List or create a branch |
Master these seven and you can work productively. The rest, like rebase and cherry-pick, you learn when a situation calls for them.
A simple daily workflow
- Pull first. Run git pull to get the latest code before you start.
- Make a branch. git checkout -b fix-login keeps your work separate from the main line.
- Edit, then check. Use git status to see what changed.
- Stage and commit. git add the files, then git commit with a clear message describing the why.
- Push the branch. git push sends it to GitHub.
- Open a pull request. On GitHub, propose merging your branch; reviewers comment and approve.
- Merge and clean up. Once approved, merge it and delete the branch.
// a typical small change, start to finish
git checkout -b fix-typo
git add README.md
git commit -m "Fix typo in setup steps"
git push origin fix-typo
Commit messages should say what changed and why, in plain words. Future you will be grateful.
Common mistakes
- Committing everything at once. Huge commits are hard to review and to undo. Keep them small and focused.
- Vague messages. "fix" or "stuff" tells no one anything. Write a short, specific summary.
- Working straight on the main branch. Use branches so unfinished work never breaks the shared code.
- Force-pushing carelessly. git push --force can erase others work. Avoid it on shared branches.
- Fearing mistakes. Almost everything in Git is recoverable. That safety net is the whole point.
FAQ
What is the difference between Git and GitHub?
Git is the version-control software running on your computer that tracks changes. GitHub is a website that hosts Git repositories online and adds collaboration tools. Git is the engine; GitHub is one place to park it.
Do I have to use the command line for Git?
No. Desktop apps and editor integrations, including the Git panel in VS Code, handle the same actions visually. Learning the core commands still helps you understand what those buttons do.
What is a pull request?
A pull request is a proposal on GitHub to merge changes from one branch into another. It lets others review and discuss the code before it becomes part of the main project.
Can I undo a commit in Git?
Yes. Commits can be reverted, reset, or amended, and even deleted branches can often be recovered. This reversibility is why you can experiment without fear.
Where to go next
Read Git versus GitHub explained, learn what Git is, and understand a Git commit in depth.