Skip to content
CodeKruPro

git fetch versus git pull

QuizEasy-MediumAsked in: Accenture, Capgemini, TCS

How do git fetch and git pull differ?

  • fetch downloads new commits and updates remote-tracking branches (your local copies of the remote branches) such as origin/main without touching your branch; pull fetches and then combines them with your branch (merge or rebase)
  • pull only downloads; fetch also merges
  • They are identical
  • fetch uploads your commits

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in