0 votes
18 views
in Technology by (230k points)

What is the difference between git pull and git fetch?

1 Answer

0 votes
by (230k points)

Git pull command pulls new changes or commits from a particular branch from your central repository and updates your target branch in your local repository.

Git fetch is also used for the same purpose but it works in a slightly different way. When you perform a git fetch, it pulls all new commits from the desired branch and stores it in a new branch in your local repository. If you want to reflect these changes in your target branch, git fetch must be followed with a git merge. Your target branch will only be updated after merging the target branch and fetched branch. Just to make it easy for you, remember the equation below:

Git pull = git fetch + git merge 

Related questions

0 votes
1 answer 31 views
0 votes
1 answer 17 views
0 votes
1 answer 27 views
0 votes
1 answer 23 views
0 votes
1 answer 35 views
0 votes
1 answer 69 views
0 votes
0 answers 39 views
0 votes
1 answer 21 views
0 votes
1 answer 31 views
0 votes
1 answer 28 views
asked Nov 4, 2020 in Technology by JackTerrance (230k points)
0 votes
1 answer 38 views
0 votes
1 answer 25 views
0 votes
1 answer 25 views
0 votes
1 answer 61 views
0 votes
1 answer 19 views
0 votes
1 answer 20 views
0 votes
1 answer 22 views
asked Nov 4, 2020 in Technology by JackTerrance (230k points)
0 votes
1 answer 39 views
asked Nov 2, 2020 in Technology by JackTerrance (230k points)
0 votes
1 answer 20 views
asked Nov 2, 2020 in Technology by JackTerrance (230k points)
0 votes
1 answer 28 views
...