git basic tutorial (35) git pull to pull remote code

1. The basic concept of git pull

The function of the git pull command is to retrieve the update of a certain branch of the remote host, and then merge it with the specified local branch.

blog.csdnimg.cn/adc2e3e1f693452f9c3a79792df9f262.png)

One sentence summarizes the difference between git pull and git fetch:

git pull = git fetch + git merge/rebase

git fetch does not automatically merge, it just pulls the code from the remote warehouse to the local remote branch. After execution, you need to manually execute git merge to merge the branch, and git pull pulls the remote branch and directly merges with the local branch. More precisely, git pull runs git fetch with the given arguments and, depending on the options passed in, calls git merge or rebase to merge the retrieved branch heads into the current branch.

Due to the execution of git merge, git pull will produce two results:</

Guess you like

Origin blog.csdn.net/HandsomeHong/article/details/131039594