Git pull vs Git Fetch

0 votes
What is the difference between git pull and git fetch?
Apr 26, 2018 in Git & GitHub by Atul
• 10,240 points
520 views

1 answer to this question.

0 votes

The objective of both these commands is the same - to get updates from the remote repository to my local repository.

But, they work in a different way.

Git pull: when you do a git pull, it gets all the changes from the remote or central repository and attaches it to your corresponding branch in your local repository.

Git fetch: when you do a git fetch, it gets all the changes from the remote repository, stores the changes in a separate branch in your local repository and if you want to reflect those changes in your corresponding branches, use a git merge to do that.

To summarize,

git pull = git fetch + git merge

answered Apr 26, 2018 by DragonLord999
• 8,420 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,484 views
0 votes
2 answers

What is the difference between git fetch and git pull?

Hii.. I HOPE BELOW ANSWER  MAY HELP YOU- In ...READ MORE

answered Jul 17 in Git & GitHub by anonymous
354 views
0 votes
1 answer

Error: git pull fails “unable to resolve reference” “unable to update local ref”

This happens when there are unnecessary files ...READ MORE

answered Jul 26, 2018 in Git & GitHub by Sophie may
• 9,940 points
6,062 views
+3 votes
1 answer

Git vs Mercurial

I'm going to put down pros and ...READ MORE

answered Sep 20, 2018 in Git & GitHub by lina
• 8,200 points
289 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
598 views
0 votes
1 answer
0 votes
1 answer

Git origin not found

For this to work, you need to ...READ MORE

answered Apr 25, 2018 in Git & GitHub by DragonLord999
• 8,420 points
366 views
0 votes
1 answer

Configure Git and GitHub

In version control with Git, we deal ...READ MORE

answered Apr 26, 2018 in Git & GitHub by DragonLord999
• 8,420 points
71 views