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,230 points
753 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,450 points

Related Questions In Git & GitHub

+1 vote
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
4,992 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 18, 2020 in Git & GitHub by anonymous
2,307 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
• 10,550 points
11,915 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,220 points
441 views
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,292 views
+2 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,450 points
627 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,450 points
158 views