Basically, git commit "records changes to the repository" while git push "updates remote refs along with associated objects". So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository.

Here is a nice picture from Oliver Steele, that explains the Git model and the commands:

Read more about git push and git pull on Pushing and pulling (the article I referred to first).

Answer from tanascius on Stack Overflow
🌐
Earth Data Science
earthdatascience.org › home
First steps with git: clone, add, commit, push | Earth Data Science - Earth Lab
September 12, 2017 - Learn basic git commands, including clone, add, commit, and push.
Discussions

Whats the purpose of a git commit VS git push?
Some programmers like to have a clean commit history, so after they make all the commits like "A small fix", "Correction to the fix", "It works this time" etc, they squash commits and rewrite them so they make sense. Also, one might not want to have their commits on the server before it's finished so it can be rebased and corrected without force pushing. More on reddit.com
🌐 r/learnprogramming
28
48
February 6, 2023
using-git - incremental_games
Make changes in my master branch related to the issue and make sure everything works. It's important to only work on one issue at a time. ... git commit -m "Fixed bug foo, closes #1" - Commit the change locally. GitHub has a nice feature that will allow your commit messages to close issues. This is great for cross referencing as well. git push ... More on reddit.com
🌐 r/incremental_games
What is this? Got it while `git push origin master` today!
66K subscribers in the git community. More on reddit.com
🌐 r/git
16
19
June 20, 2017
Latest Commit Is Not What Gets Pushed. Very Confused, Started Git Yesterday, Can't Find Guidance That I Actually Understand : git
Latest Commit Is Not What Gets Pushed. Very Confused, Started Git Yesterday, Can't Find Guidance That I Actually Understand (self.git) ... Post a comment! ... Use of this site constitutes acceptance of our User Agreement and Privacy Policy. © 2023 reddit inc. More on beta.reddit.com
🌐 r/git
🌐
Git
git-scm.com › docs
Git - Reference
commit · notes · restore · reset · rm · mv · branch · checkout · switch · merge · mergetool · log · stash · tag · worktree · fetch · pull · push · remote · submodule · show · log · diff · difftool · range-diff · shortlog · describe ·
🌐
GeeksforGeeks
geeksforgeeks.org › git › what-is-git-push
Git Push - GeeksforGeeks
March 14, 2026 - This command pushes the commits from the local main branch to the main branch of the remote repository origin. ... Overwrites remote history with your local history. Use only in special cases (e.g., rewriting commits).
🌐
Graphite
graphite.com › guides › git-add-commit-push
Git add, commit, and push
Finally, git push transfers those snapshots from your local repository to a remote repository, making them visible to your team. In other words, think of git add as preparing your changes, git commit as finalizing them into a checkpoint in your project’s history, and git push as publishing that checkpoint for others to pull.
Find elsewhere
🌐
Git
git-scm.com › cheat-sheet
Git Cheat Sheet
git checkout <commit> <file> OR git restore <file> --source <commit> git remote add <name> <url> git push origin main · git push · git push -u origin <name> git push --force-with-lease · git push --tags · git fetch origin main · git pull --rebase · git pull origin main OR git pull ·
🌐
Rocket Software
docs.rocketsoftware.com › bundle › jne1644018840225 › page › cag1644018849870.html
Commit and push changes to Git repository
Skip to main contentSkip to search · Powered by Zoomin Software. For more details please contactZoomin · Log in to get a better experience · Login · Rocket Software · 77 4th Avenue Waltham, MA 02451 USA · Products · About · Contact · Resources
🌐
Medium
frankgwarman.medium.com › the-first-pull-commit-and-push-with-git-fb620b0e630b
The first Pull, Commit, and Push with Git! | by Frank Warman | Medium
June 20, 2023 - The git commit command only commits to your local branches. You will not be able to interact with these online, yet. Pushing your local commit to the remote server will complete the process!
🌐
Reddit
reddit.com › r/learnprogramming › whats the purpose of a git commit vs git push?
r/learnprogramming on Reddit: Whats the purpose of a git commit VS git push?
February 6, 2023 -

Just to be clear, I know what git add, commit, and push all do. When I write code and I solved some bug, what I do is

git add .
git commit -m "this thing finally works'
git push origin main

I never do a commit that I don't push right after. And that's because I don't get why I should commit what I don't intend to push. And if I don't intent to push, why commit? Just to be clear, I know HOW these commands work. I don't understand their WHY.

🌐
Unwiredlearning
unwiredlearning.com › blog › git-push-github
Git Push to GitHub: How to Push Commits Safely
March 5, 2026 - Learn programming, web development, and software engineering with in-depth tutorials, code examples, and best practices from the Unwired Learning team.
🌐
GitLab
docs.gitlab.com › topics › git › commit
Stage, commit, and push changes | GitLab Docs
You can stage all your changes and commit them with one command: git commit -a -m "<comment that describes the changes>" Be careful your commit doesn’t include files you don’t want to record to the remote repository. As a rule, always check the status of your local repository before you ...
🌐
W3Schools
w3schools.com › git › git_commit.asp
Git Commit
You can skip the staging step for already tracked files with git commit -a -m "message". This commits all modified and deleted files, but not new/untracked files.
🌐
Graphite
graphite.com › guides › git-commit-vs-push
Understanding the differences between `git commit` and `git push`
git commit is a local operation; it affects only your local repository and does not interact with the remote repository. Until they're pushed, commits exist only on your local machine.
🌐
GeeksforGeeks
geeksforgeeks.org › git › difference-between-git-commit-and-git-push
Difference Between "git commit" and "git push"? - GeeksforGeeks
July 29, 2024 - Documentation: Commit messages serve as a log that documents the progress and changes in the project. ... git push uploads contents from your local repository to a remote repository.
🌐
JetBrains
jetbrains.com › help › pycharm › commit-and-push-changes.html
Commit and push changes to Git repository | PyCharm Documentation
February 16, 2026 - When you're ready, click Commit or Commit and Push (Ctrl+Alt+K) to push the changes to the remote repository immediately after the commit. You will be able to review the current commit as well as all other commits before they are pushed to the ...
🌐
pre-commit
pre-commit.com
pre-commit
Previously, commit, push, and merge-commit matched pre-commit, pre-push, and pre-merge-commit respectively. The manual stage (via stages: [manual]) is a special stage which will not be automatically triggered by any git hook -- this is useful if you want to add a tool which is not automatically ...
🌐
Medium
chancecornell.medium.com › how-to-commit-and-push-to-git-d53004bcc1e9
How to commit and push to Git.. When using Git with your projects… | by Chance Cornell | Medium
June 15, 2021 - How to commit and push to Git. When using Git with your projects, there are three things that we need to do. Pull, Commit, Push. We will talk about how to do each of those next. If we continue to do …
🌐
JetBrains
jetbrains.com › help › clion › commit-and-push-changes.html
Commit and push changes to Git repository | CLion Documentation
February 16, 2026 - When you're ready, click Commit or Commit and Push (Ctrl+Alt+K) to push the changes to the remote repository immediately after the commit. You will be able to review the current commit as well as all other commits before they are pushed to the ...