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 GitReady.com (the article I referred to first)
Related Posts:
- What does ‘–set-upstream’ do?
- What does ‘–set-upstream’ do?
- How do I properly force a Git push?
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- error: src refspec master does not match any
- How do I undo the most recent local commits in Git?
- What is the difference between git push origin and git push origin master
- How to modify existing, unpushed commit messages?
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How do you push a tag to a remote repository using Git?
- Remove files from Git commit
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- Pushing empty commits to remote
- rejected master -> master (non-fast-forward)
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- rejected master -> master (non-fast-forward)
- Meaning of the GitHub message: push declined due to email privacy restrictions
- Git Giving “fetch first” error when trying to push
- How to undo git reset –soft to get my changes back?
- git – Your branch is ahead of ‘origin/master’ by 1 commit
- ! [rejected] master -> master (fetch first)
- Set up git to pull and push all branches
- How can I remove a commit on GitHub?
- Undoing a ‘git push’
- What does git push origin HEAD mean?
- What does git push origin HEAD mean?
- How do I push a local Git branch to master branch in the remote?
- Git – Remove commit from history
- git push not send changes to remote git repository
- Differences between Commit, Commit and Push, Commit and Sync
- Git push hangs when pushing to Github?
- How can I push a specific commit to a remote, and not previous commits?
- Git Push Error: insufficient permission for adding an object to repository database
- Git push requires username and password
- How do I rename a local Git branch?
- What does cherry-picking a commit with Git mean?
- Git refusing to merge unrelated histories on rebase
- git – remote add origin vs remote set-url origin
- How to upgrade Git on Windows to the latest version
- git: fatal: Could not read from remote repository
- Windows git “warning: LF will be replaced by CRLF”, is that warning tail backward?
- What does “Changes not staged for commit” mean
- How to change the URI (URL) for a remote Git repository?
- What would I use git-worktree for?
- How can I merge multiple commits onto another branch as a single squashed commit?
- Git error when trying to push — pre-receive hook declined
- How do I revert all local changes in Git managed project to previous state?
- How to revert multiple git commits?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- You have not concluded your merge (MERGE_HEAD exists)
- git – pulling from specific branch
- How to copy commits from one branch to another?
- Another git process seems to be running in this repository
- How do you stash an untracked file?
- How do I call git diff on the same file between 2 different local branches?
- How to git rebase a branch with the onto command?
- Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
- Remove a git commit which has not been pushed
- Remove a git commit which has not been pushed
- There is no tracking information for the current branch
- Git push results in “Authentication Failed”
- What are the differences between .gitignore and .gitkeep?
- What’s the difference between git switch and git checkout
- What is the point of ‘git submodule init’?
- Git nothing added to commit but untracked files present – even with those files added to gitignore
- ERROR: Error cloning remote repo ‘origin’
- git push to specific branch
- git: How to ignore all present untracked files?
- Move existing, uncommitted work to a new branch in Git
- Delete branches in Bitbucket
- What to gitignore from the .idea folder?git intellij-idea gitignore webstorm
- How do you clone a Git repository into a specific folder?
- Aborting commit due to empty commit message
- git checkout master error: the following untracked working tree files would be overwritten by checkout
- How to update a branch with master on GitHub
- How can I see the changes in a Git commit?
- Git removing upstream from local repository
- Git pull – Please move or remove them before you can merge
- Unlink of file Failed. Should I try again?
- How to recover stashed uncommitted changes
- Git Pull is Not Possible, Unmerged Files
- Resetting remote to a certain commit
- Change the location of the ~ directory in a Windows install of Git Bash
- Where is git.exe located?
- How to find which git branch I am on when my disk is mounted on other server
- Git checkout – switching back to HEAD
- How to create a new branch from a tag?
- Workflow for working with git and WordPress
- best practice on pushing staging development (database/uploads) to the live server
- Initial wordpress deploy via git
- How to use wordpress with Git?
- Is it possible to checkout a beta version of WordPress via github?
- how can I create a WP offline environment before releasing the websites? [closed]