What is the difference between git fetch and git pull?

0 votes
When should we use and what is the main difference between them??
Mar 3 in Git & GitHub by kartik
• 16,870 points
274 views

1 answer to this question.

0 votes

Hii @kartik,

The main difference between git fetch and git pull is:

  • If you do a git fetch it will just fetch all the changes in the remote repository (Github) and move the origin/master pointer to HEAD. Meanwhile your local branch master will keep pointing to where it has.
  • If you do a git pull, it will do basically fetch (as explained previously) and merge any new changes to your master branch and move the pointer to HEAD.

So, git pull=git fetch + merge.

answered Mar 3 by Niroj
• 35,060 points

Related Questions In Git & GitHub

0 votes
1 answer

difference between git fetch and git pull

Both fetch and pull are used to ...READ MORE

answered Jun 27, 2018 in Git & GitHub by anonymous
3,315 views
0 votes
2 answers

What's the difference between git push and git commit?

I installed ubuntu on vagrant and gave ...READ MORE

answered Jan 2, 2019 in Git & GitHub by Ali
• 10,670 points
361 views
0 votes
0 answers

Difference between git rebase and git merge? Which among them is better to use?

Difference between git rebase and git merge? ...READ MORE

Nov 25, 2019 in Git & GitHub by anonymous
• 10,310 points

closed Nov 25, 2019 by Sirajul 153 views
0 votes
3 answers

difference between git remote and git clone

HI.... GIT REMOTE add just creates an entry in ...READ MORE

answered 3 days ago in Git & GitHub by anonymous
3,003 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
555 views
0 votes
1 answer
0 votes
1 answer