Title: What git pull does to your branch when the remote has moved
Open Graph Title: What git pull does to your branch when the remote has moved
X Title: What git pull does to your branch when the remote has moved
Description: git pull fetches your upstream branch's new commits and merges them into your branch. Watch both halves on a real repository where you and a teammate have both committed, see where the surprise merge commit comes from, and learn the two settings that change it.
Open Graph Description: git pull fetches your upstream branch's new commits and merges them into your branch. Watch both halves on a real repository where you and a teammate have both committed, see where the surprise merge commit comes from, and learn the two settings that change it.
X Description: git pull fetches your upstream branch's new commits and merges them into your branch. Watch both halves on a real repository where you and a teammate have both committed, see where the surprise merge commit comes from, and learn the two settings that change it.
Mail addresses
jacob@initialcommit.io
jacob@initialcommit.io
Opengraph URL: https://initialcommit.com/learn/git/commands/git-pull
Domain: initialcommit.com
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "git pull: fetch, then merge, in one command",
"alternativeHeadline": "What git pull does to your branch when the remote has moved",
"description": "git pull fetches your upstream branch's new commits and merges them into your branch. Watch both halves on a real repository where you and a teammate have both committed, see where the surprise merge commit comes from, and learn the two settings that change it.",
"image": ["https:\/\/initialcommit.com\/img\/initialcommit\/git-pull-fbc55cb5.jpg","https:\/\/initialcommit.com\/img\/initialcommit\/git-pull-fbc55cb5-light.jpg"],
"datePublished": "2026-10-02",
"dateModified": "2026-10-14",
"author": {
"@type": "Person",
"name": "Jacob Stopak",
"url": "https:\/\/initialcommit.com\/blog\/author\/jacobstopak",
"sameAs": ["https:\/\/github.com\/initialcommit-com","https:\/\/www.linkedin.com\/in\/jacob-stopak-6361b4b7","https:\/\/x.com\/initcommit","https:\/\/www.instagram.com\/initialcommit","https:\/\/initialcommit.com"]
},
"publisher": {
"@type": "Organization",
"name": "Initial Commit",
"url": "https:\/\/initialcommit.com",
"logo": { "@type": "ImageObject", "url": "https:\/\/initialcommit.com\/img\/initialcommit\/logo.png" }
},
"mainEntityOfPage": "https:\/\/initialcommit.com\/learn\/git\/commands\/git-pull",
"keywords": "git vcs topic:team",
"inLanguage": "en",
"isAccessibleForFree": true
}
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https:\/\/initialcommit.com" },
{ "@type": "ListItem", "position": 2, "name": "Learn Git", "item": "https:\/\/initialcommit.com\/learn\/git" },
{ "@type": "ListItem", "position": 3, "name": "Git commands", "item": "https:\/\/initialcommit.com\/learn\/git\/commands" },
{ "@type": "ListItem", "position": 4, "name": "git pull: fetch, then merge, in one command", "item": "https:\/\/initialcommit.com\/learn\/git\/commands\/git-pull" }
]
}
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the difference between git pull and git fetch?",
"acceptedAnswer": {
"@type": "Answer",
"text": "fetch downloads commits and moves origin/main, leaving your branch alone. pull does that and then merges (or rebases) the result into your branch."
}
},
{
"@type": "Question",
"name": "Why did git pull create a merge commit?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Because both you and the remote had new commits. Git combined them with a merge commit. git pull --rebase avoids that by replaying your commits on top instead."
}
},
{
"@type": "Question",
"name": "What does \"need to specify how to reconcile divergent branches\" mean?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Your branch and the remote both have new commits and you haven't told Git whether to merge or rebase by default. Set pull.rebase to true or false, or pull.ff to only."
}
},
{
"@type": "Question",
"name": "How do I undo a git pull?",
"acceptedAnswer": {
"@type": "Answer",
"text": "git reset --hard ORIGHEAD immediately after, or find the pre-pull commit in the reflog with git reflog."
}
}
]
}
| None | IE=edge |
| theme-color | #ffffff |
| ic-lesson-total | 16 |
| ic-lesson-paths | /learn/git/levels/git-overview,/learn/git/levels/init-and-config,/learn/git/levels/add-and-commit,/learn/git/levels/log-and-status,/learn/git/levels/clone-and-remote,/learn/git/levels/push-and-pull,/learn/git/levels/branch-and-switch,/learn/git/levels/merge,/learn/git/levels/tag,/learn/git/levels/stash,/learn/git/levels/restore,/learn/git/levels/revert,/learn/git/levels/reset,/learn/git/levels/rebase,/learn/git/levels/detached-head,/learn/git/levels/remove-and-rename |
| ic-lesson | /learn/git/levels/remove-and-rename|Level 16: Remove & rename |
| og:type | article |
| og:site_name | Initial Commit |
| og:image | https://initialcommit.com/img/initialcommit/git-pull-fbc55cb5.jpg |
| og:image:secure_url | https://initialcommit.com/img/initialcommit/git-pull-fbc55cb5.jpg |
| og:updated_time | 2026-10-14 |
| og:article:published_time | 2026-10-02 |
| og:article:modified_time | 2026-10-14 |
| og:article:author | Jacob Stopak |
| og:article:section | Programming |
| og:article:tag | topic:team |
| twitter:card | summary_large_image |
| twitter:url | https://initialcommit.com/learn/git/commands/git-pull |
| twitter:image | https://initialcommit.com/img/initialcommit/git-pull-fbc55cb5.jpg |
Links:
Viewport: width=device-width, initial-scale=1.0