A commit is a saved snapshot of your changes in Git. A pull request (PR) is a request on GitHub to review a branch of commits and merge it into another branch, usually main.
18 August 2026 · Updated 15 November 2026 · 12 min · Lesson
People mix these up. A commit is a snapshot you already saved. A pull request — a GitHub PR — is the ask to land one or more of those snapshots on main. This lesson is that difference: a table, which one comes first, a worked example with real commands, and the two words around them, repository and merge.
We stay on the happy path. Squash and rebase get one short answer at the bottom. First you need to know what you are looking at on GitHub.
The same lesson as a three-minute video: one branch, two commits, one pull request. Narrated by an AI voice.
Click a seat, or walk the loop
A repository is the project
A repo holds the files and the history. On GitHub it has a name, like notes. Everyone on the team clones the same repo. You do not email zip files around.
Commit vs pull request, side by side
Commit
Pull request
What it is
A saved snapshot of your files, with a message
A proposal to merge one branch into another
Where it lives
In Git. On your laptop first, on GitHub after you push
On GitHub. Git itself has no pull request
How you make one
git commit
The Compare & pull request button, or gh pr create
Its name
A hash, like c3f1a2
A number, like #12
What is inside
The changed lines, an author, a time, a message
A title, a description, one or more commits, the diff, comments, reviews, checks
Needs the other?
No. A commit can exist with no pull request
Yes. It needs at least one commit to propose
Who sees it
Only you, until you push
Everyone with access to the repository
How it ends
It does not. It stays in the history
Merged, or closed without merging
You can make ten commits and never ask anyone to look. The work lives on your branch. A pull request is the named place where those commits become a proposal: the diff, the comments, the checks, the merge button.
The commit answers “what changed, and why.” The pull request answers “may this change become the product?” An AI code pipeline reviews the pull request. It cannot review a commit that never asked.
Which comes first, the commit or the pull request?
The commit. A pull request compares two branches. If your branch has no commit that main lacks, there is nothing to compare and nothing to ask for.
The order on a normal day:
Make a branch.
Commit on it. Once or ten times.
Push the branch to GitHub.
Open a pull request from that branch into main.
Push more commits if review asks for them.
Merge.
How commits, branches and pull requests fit together
A branch is a line of commits with a name. Main is a branch. Your rate-limit branch starts at main and grows one commit at a time.
A pull request points at two branches: the one with your commits, and the base you want them in. It does not copy the commits. It watches the branch. Push a new commit to the branch and the pull request shows it.
So the nesting is: a repository holds branches, a branch holds commits, and a pull request asks to move one branch’s commits into another.
A worked example: two commits, one pull request
One small change, start to finish. The git commands run on your laptop. gh is GitHub’s command line tool. The button on the website does the same thing.
Make a branch and save one commit on it:
git switch -c rate-limit
git add src/limit.ts
git commit -m "Return 429 when over the limit"
That commit exists only on your laptop. Nobody has been asked anything. Push the branch, then open the pull request:
git push -u origin rate-limit
gh pr create --base main --title "Add a 429 path" --body "Returns 429 when a client is over the limit."
Now there is a pull request with one commit in it. A reviewer asks for a test. You do not open a second pull request. You add a commit to the same branch:
Same pull request, two commits. To list the commits the pull request is carrying:
git log --oneline main..rate-limit
When the review is done, someone clicks Merge pull request. Both commits land on main and the pull request closes.
A repository is the shared project
A repository (repo) is the folder GitHub remembers for you. It has a name. It has files. It has a history. The team clones it. Your laptop copy and the copy on GitHub are meant to stay in conversation.
If there is no repo, there is no shared history. You cannot open a pull request on a zip file in Slack.
A commit is one saved step
A commit is a snapshot plus a message. You changed src/limit.ts. You wrote “Explain the 429 path.” Git stored that. The next commit sits on top of it.
Commits are the material. They are not the review. On GitHub you usually meet a commit inside a pull request: a message and a short hash on the conversation.
Inside one pull request. The description is the ask. The row with the hash is the first commit — the snapshot that opened it.
A pull request is the ask
You do not edit main in secret and hope. You make a branch, commit there, then open a pull request. The PR shows the diff against main. People comment on it. CI can run on it. A model can take a first pass on it.
Until someone merges, the change is a proposal. That is the whole point of a PR: a named place to look before the code is the product.
The Pull requests tab is the inbox of those asks. Open, merged, or closed without merging. Each row is one proposal, not one commit.
The Pull requests tab. Each row is one ask — a title, a number, merged or closed. Not a list of commits.
One pull request, more than one commit
The first commit opens the proposal. Later commits can land on the same PR — a fix, a follow-up, a push after review. Still commits. Still one ask.
A later commit on the same pull request. Same ask, new snapshot — here a fix that landed after review.
Merge is the finish
Merge means the proposal is accepted. The commits join main. The PR closes. Later you ship from main.
Who clicks Merge is the owner. Tools can comment. Tests can go red. A human still decides the change is allowed on the line everyone deploys.
How this becomes a pipeline
Write. Commit. Open a PR. Review. Merge. That is already a pipeline. An AI code pipeline puts a model in one of those seats — usually the first pass on the PR — and keeps the human on merge.
If the words above are new, stop here and walk the loop once on a real repo: one file, one commit, one PR, one merge. Then take the next lesson.
Questions people ask
What is the difference between a commit and a pull request?
A commit is a saved snapshot of changes in Git, made with git commit. A pull request is a page on GitHub that proposes merging one branch's commits into another branch, and it holds the review, the checks and the merge decision. A commit records work. A pull request asks for that work to be accepted.
Which comes first, the commit or the pull request?
The commit. A pull request compares two branches, so the branch you propose needs at least one commit the base branch does not have. You commit, push the branch, then open the pull request.
Is a PR the same as a commit?
No. A PR is not a kind of commit and a commit is not a small PR. The commit is the content. The PR is the container around one or more commits where people review them.
Can a pull request have more than one commit?
Yes. Every commit you push to the branch while the pull request is open is added to it. One pull request with five commits is normal.
Can I commit without opening a pull request?
Yes. Commits live in Git and need no pull request. You can commit on your laptop all day, and you can push straight to a branch if the repository allows it. Many teams protect main so that changes reach it only through a pull request.
What is the difference between a push and a pull request?
git push uploads your commits to a branch on GitHub. A pull request asks to merge that branch into another one. Pushing to a branch that already has an open pull request updates the pull request.
What happens to the commits when a pull request is merged?
It depends on the merge option. On GitHub the default, a merge commit, keeps every commit and adds one merge commit. Squash and merge combines them into a single commit on the base branch. Rebase and merge adds each commit on its own, without a merge commit.
Is a pull request part of Git?
No. Commits and branches are Git. The pull request is a feature of the host. GitHub calls it a pull request. GitLab calls the same idea a merge request. Pull request vs merge request has the details.
Next lesson
You know commit and pull request. GitLab calls the same ask a merge request. See what changes and what does not.