In the simplest terms, git pull
does a git fetch
followed by a git merge
.
You can do a git fetch
at any time to update your remote-tracking branches under refs/remotes/<remote>/
. This operation never changes any of your own local branches under refs/heads
, and is safe to do without changing your working copy. I have even heard of people running git fetch
periodically in a cron job in the background (although I wouldn’t recommend doing this).
A git pull
is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.
From the Git documentation for git pull
:
In its default mode,
git pull
is shorthand forgit fetch
followed bygit merge FETCH_HEAD
.
Related Posts:
- Git: How do I force “git pull” to overwrite local files?
- Git: How do I force “git pull” to overwrite local files?
- Git: How do I force “git pull” to overwrite local files?
- How do I discard unstaged changes in Git?
- How can I make git accept a self signed certificate?
- Why does git say “Pull is not possible because you have unmerged files”?
- Why does git say “Pull is not possible because you have unmerged files”?
- How can I revert multiple Git commits (already pushed) to a published repository?
- Git: cannot do a partial commit during a merge (SourceTree)
- What is the meaning of git reset –hard origin/master?
- Why does git say “Pull is not possible because you have unmerged files”?
- Why does ‘git commit’ not save my changes?
- How can I undo git reset –hard HEAD~1?
- git push to specific branch
- Get changes from master into branch in Git
- Is it possible to pull just one file in Git?
- Rebasing remote branches in Git
- What is the Git equivalent for revision number?
- difference between git merge origin/master and git pull
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- How do I rename a local Git branch?
- How do I undo the most recent local commits in Git?
- Differences between git pull origin master & git pull origin/master
- How do I force git pull to overwrite everything on every pull?
- How do I rename a local Git branch?
- How can I switch to another branch in git?
- Git fetch remote branch
- How do I discard unstaged changes in Git?
- Git fetch remote branch
- Download single files from GitHub
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- Git: How to squash all commits on branch
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- Why git asks to enter a commit message to explain why this merge is necessary
- The following untracked working tree files would be overwritten by merge, but I don’t care
- Undo git pull, how to bring repos to old state
- What does “Git push non-fast-forward updates were rejected” mean?
- Undo git pull, how to bring repos to old state
- There is no tracking information for the current branch
- How can I reset or revert a file to a specific revision?
- Else clause on Python while statement
- How do I ignore an error on ‘git pull’ about my local changes would be overwritten by merge?
- Files not updating using ‘git pull’
- The following untracked working tree files would be overwritten by merge, but I don’t care
- git checkout tag, git pull fails in branch
- Delete all local git branches
- Set up git to pull and push all branches
- Invalid VCS root mapping – 3 errors on my project
- Updates were rejected because the remote contains work that you do not have locally
- how to reset develop branch to master
- Do I commit the package-lock.json file created by npm 5?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- 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
- How to `git pull` while ignoring local changes?
- How can I delete all Git branches which have been merged?
- git fetch doesn’t update my local repository
- What’s a good (free) visual merge tool for Git? (on windows)
- Git push requires username and password
- Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files? [closed]
- Should I use SVN or Git?
- WordPress Health Tool reporting version control as a critical issue
- storing database in version control
- Is it better to create a Git repository at the root level or in the WordPress theme directory?
- Pull latest stable release via git [closed]
- How should I be handling my theme version numbering?
- Version control with a team of non-developers
- Painless way to track remote Git repo for WordPress updates
- Questions about Git and WordPress [duplicate]
- How to rename the wp-config.php file once under version control?
- How to use one git (github) repository for version control for multiple themes
- version control for wordpress? (wordpress folder and database at same time)
- Revision History for Entire WordPress Site
- WordPress and Git: How does Git interact with your IDE? [closed]
- What is git tag, How to create tags & How to checkout git remote tag(s)
- What is the best (and safest) way to merge a Git branch into master?
- Gitignore not working
- Could not open a connection to your authentication agent
- How to get just one file from another branch?
- git checkout a single file from another branch and put in different folder
- Update Git branches from master
- Stash only one file out of multiple files that have changed with Git?
- GitHub: invalid username or password
- Why do I have to “git push –set-upstream origin
“? - Stash just a single file
- Clone A Private Repository (Github)
- How do I set up Eclipse/EGit with GitHub?
- Repository size limits for GitHub.com
- git push origin master does not work
- How to configure git bash command line completion?
- How to stop tracking and ignore changes to a file in Git?
- Why do the Roots theme CSS files not load (404)?
- Is there any good way to use SVN for uploads directory?
- WordPress multisite – What’s the ideal setup for development/staging/production environments?
- When developing entire sites for clients, is it viable to version control the entire site? [duplicate]
- WordPress on git – need help with configuration
- Updating a WP Plugin SVN not showing on WordPress Website or Zip