Bird
0
0

What is the main difference between git fetch and git pull?

easy📝 Conceptual Q11 of 15
Git - Remote Repositories
What is the main difference between git fetch and git pull?
A<code>git fetch</code> deletes local changes; <code>git pull</code> only downloads updates.
B<code>git fetch</code> downloads updates without changing files; <code>git pull</code> downloads and merges updates.
C<code>git fetch</code> merges changes automatically; <code>git pull</code> only downloads updates.
D<code>git fetch</code> uploads changes; <code>git pull</code> downloads changes.
Step-by-Step Solution
Solution:
  1. Step 1: Understand git fetch behavior

    git fetch downloads updates from the remote repository but does not change your working files or current branch.
  2. Step 2: Understand git pull behavior

    git pull downloads updates and immediately merges them into your current branch, changing your files.
  3. Final Answer:

    git fetch downloads updates without changing files; git pull downloads and merges updates. -> Option B
  4. Quick Check:

    Fetch = download only, Pull = download + merge [OK]
Quick Trick: Fetch only downloads; pull downloads and merges [OK]
Common Mistakes:
  • Thinking fetch changes files immediately
  • Confusing pull as only download
  • Believing fetch uploads changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes